From 27e1398be3821f814aee4eaf7627b2d8fb5c4934 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sat, 20 Feb 2016 13:51:02 +0000 Subject: Shell reorganization. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8913 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- testhal/STM32/STM32F7xx/USB_CDC/main.c | 59 +--------------------------------- 1 file changed, 1 insertion(+), 58 deletions(-) (limited to 'testhal/STM32/STM32F7xx/USB_CDC/main.c') diff --git a/testhal/STM32/STM32F7xx/USB_CDC/main.c b/testhal/STM32/STM32F7xx/USB_CDC/main.c index b75c37cda..d703f52c5 100644 --- a/testhal/STM32/STM32F7xx/USB_CDC/main.c +++ b/testhal/STM32/STM32F7xx/USB_CDC/main.c @@ -31,59 +31,6 @@ /*===========================================================================*/ #define SHELL_WA_SIZE THD_WORKING_AREA_SIZE(2048) -#define TEST_WA_SIZE THD_WORKING_AREA_SIZE(256) - -static void cmd_mem(BaseSequentialStream *chp, int argc, char *argv[]) { - size_t n, total, largest; - - (void)argv; - if (argc > 0) { - chprintf(chp, "Usage: mem\r\n"); - return; - } - n = chHeapStatus(NULL, &total, &largest); - chprintf(chp, "core free memory : %u bytes\r\n", chCoreGetStatusX()); - chprintf(chp, "heap fragments : %u\r\n", n); - chprintf(chp, "heap free total : %u bytes\r\n", total); - chprintf(chp, "heap free largest: %u bytes\r\n", largest); -} - -static void cmd_threads(BaseSequentialStream *chp, int argc, char *argv[]) { - static const char *states[] = {CH_STATE_NAMES}; - thread_t *tp; - - (void)argv; - if (argc > 0) { - chprintf(chp, "Usage: threads\r\n"); - return; - } - chprintf(chp, "stklimit stack addr prio state name\r\n"); - tp = chRegFirstThread(); - do { - chprintf(chp, "%08lx %08lx %08lx %4lu %9s %12s\r\n", - (uint32_t)tp->stklimit, (uint32_t)tp->ctx.r13, (uint32_t)tp, - (uint32_t)tp->prio, states[tp->state], - tp->name == NULL ? "" : tp->name); - tp = chRegNextThread(tp); - } while (tp != NULL); -} - -static void cmd_test(BaseSequentialStream *chp, int argc, char *argv[]) { - thread_t *tp; - - (void)argv; - if (argc > 0) { - chprintf(chp, "Usage: test\r\n"); - return; - } - tp = chThdCreateFromHeap(NULL, TEST_WA_SIZE, chThdGetPriorityX(), - TestThread, chp); - if (tp == NULL) { - chprintf(chp, "out of memory\r\n"); - return; - } - chThdWait(tp); -} /* Can be measured using dd if=/dev/xxxx of=/dev/null bs=512 count=10000.*/ static void cmd_write(BaseSequentialStream *chp, int argc, char *argv[]) { @@ -126,9 +73,6 @@ static void cmd_write(BaseSequentialStream *chp, int argc, char *argv[]) { } static const ShellCommand commands[] = { - {"mem", cmd_mem}, - {"threads", cmd_threads}, - {"test", cmd_test}, {"write", cmd_write}, {NULL, NULL} }; @@ -218,8 +162,7 @@ int main(void) { shellThread, (void *)&shell_cfg1); } else if (chThdTerminatedX(shelltp)) { - chThdWait(shelltp); - chHeapFree(chthdGetStackLimitX(shelltp)); + chThdFreeToHeap(shelltp); shelltp = NULL; /* Triggers spawning of a new shell. */ } #if 0 -- cgit v1.2.3