diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-08-13 12:16:57 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-08-13 12:16:57 +0000 |
commit | dfe8c5f59d5ebe47496a99396127867a2455a31a (patch) | |
tree | b80039a2e0c3d6f62a549f3bc9229ac1346abcb9 /testhal | |
parent | b6b473a6a1fde7e7154dc2f1a2abaa395d526f62 (diff) | |
download | ChibiOS-dfe8c5f59d5ebe47496a99396127867a2455a31a.tar.gz ChibiOS-dfe8c5f59d5ebe47496a99396127867a2455a31a.tar.bz2 ChibiOS-dfe8c5f59d5ebe47496a99396127867a2455a31a.zip |
Added an "usbblast" command to the demo, any key stops it.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4563 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal')
-rw-r--r-- | testhal/STM32F4xx/USB_CDC/main.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/testhal/STM32F4xx/USB_CDC/main.c b/testhal/STM32F4xx/USB_CDC/main.c index 02f7b4829..7c033e7eb 100644 --- a/testhal/STM32F4xx/USB_CDC/main.c +++ b/testhal/STM32F4xx/USB_CDC/main.c @@ -242,7 +242,7 @@ static const USBEndpointConfig ep1config = { 0x0000,
&ep1instate,
NULL,
- 2,
+ 4,
NULL
};
@@ -394,10 +394,34 @@ static void cmd_test(BaseSequentialStream *chp, int argc, char *argv[]) { chThdWait(tp);
}
+static void cmd_usbblast(BaseSequentialStream *chp, int argc, char *argv[]) {
+ static uint8_t buf[512] =
+ "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
+ "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
+ "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
+ "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
+ "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
+ "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
+ "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
+ "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef";
+
+ (void)argv;
+ if (argc > 0) {
+ chprintf(chp, "Usage: test\r\n");
+ return;
+ }
+
+ while (chnGetTimeout((BaseChannel *)chp, TIME_IMMEDIATE) == Q_TIMEOUT) {
+ chSequentialStreamWrite(&SDU1, buf, sizeof buf);
+ }
+ chprintf(chp, "\r\n\nstopped\r\n");
+}
+
static const ShellCommand commands[] = {
{"mem", cmd_mem},
{"threads", cmd_threads},
{"test", cmd_test},
+ {"usbblast", cmd_usbblast},
{NULL, NULL}
};
|