aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32/STM32F7xx/USB_CDC/main.c
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2016-02-20 13:51:02 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2016-02-20 13:51:02 +0000
commit27e1398be3821f814aee4eaf7627b2d8fb5c4934 (patch)
tree6a21849d04864f2c5d0b231862c3641aa2aa0773 /testhal/STM32/STM32F7xx/USB_CDC/main.c
parent4f3674f5f22d41dd58a6ea51d3a5fed89ef1990b (diff)
downloadChibiOS-27e1398be3821f814aee4eaf7627b2d8fb5c4934.tar.gz
ChibiOS-27e1398be3821f814aee4eaf7627b2d8fb5c4934.tar.bz2
ChibiOS-27e1398be3821f814aee4eaf7627b2d8fb5c4934.zip
Shell reorganization.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8913 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/STM32/STM32F7xx/USB_CDC/main.c')
-rw-r--r--testhal/STM32/STM32F7xx/USB_CDC/main.c59
1 files changed, 1 insertions, 58 deletions
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