From 0bae8867882af833d47fd0f09358fb13d1031570 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 14 Aug 2012 14:24:06 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4568 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- testhal/STM32F4xx/USB_CDC/main.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'testhal/STM32F4xx/USB_CDC') diff --git a/testhal/STM32F4xx/USB_CDC/main.c b/testhal/STM32F4xx/USB_CDC/main.c index 266867019..027f92a81 100644 --- a/testhal/STM32F4xx/USB_CDC/main.c +++ b/testhal/STM32F4xx/USB_CDC/main.c @@ -421,7 +421,9 @@ static void cmd_write(BaseSequentialStream *chp, int argc, char *argv[]) { while (chnGetTimeout((BaseChannel *)chp, TIME_IMMEDIATE) == Q_TIMEOUT) { chSequentialStreamWrite(&SDU1, buf, sizeof buf - 1); + palTogglePad(GPIOD, GPIOD_LED4); } + palClearPad(GPIOD, GPIOD_LED4); chprintf(chp, "\r\n\nstopped\r\n"); } @@ -451,10 +453,13 @@ static msg_t Thread1(void *arg) { (void)arg; chRegSetThreadName("blinker"); while (TRUE) { + systime_t time; + + time = USBD1.state == USB_ACTIVE ? 250 : 500; palClearPad(GPIOD, GPIOD_LED6); - chThdSleepMilliseconds(500); + chThdSleepMilliseconds(time); palSetPad(GPIOD, GPIOD_LED6); - chThdSleepMilliseconds(500); + chThdSleepMilliseconds(time); } } -- cgit v1.2.3