diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2016-11-03 12:43:09 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2016-11-03 12:43:09 +0000 |
commit | e1d8e5357927f0748fef013fb4bddebe781c60a8 (patch) | |
tree | 389cb8d73a94f53adc36d690fb8336d29cca55ea /testhal/STM32/STM32F3xx/USB_CDC | |
parent | 13537cb7240240e6c7f915aa4d2aa6772034003b (diff) | |
download | ChibiOS-e1d8e5357927f0748fef013fb4bddebe781c60a8.tar.gz ChibiOS-e1d8e5357927f0748fef013fb4bddebe781c60a8.tar.bz2 ChibiOS-e1d8e5357927f0748fef013fb4bddebe781c60a8.zip |
Tentative USB suspend fix.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9898 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/STM32/STM32F3xx/USB_CDC')
-rw-r--r-- | testhal/STM32/STM32F3xx/USB_CDC/usbcfg.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/testhal/STM32/STM32F3xx/USB_CDC/usbcfg.c b/testhal/STM32/STM32F3xx/USB_CDC/usbcfg.c index 949321a59..db05bbd8a 100644 --- a/testhal/STM32/STM32F3xx/USB_CDC/usbcfg.c +++ b/testhal/STM32/STM32F3xx/USB_CDC/usbcfg.c @@ -267,8 +267,6 @@ static void usb_event(USBDriver *usbp, usbevent_t event) { extern SerialUSBDriver SDU1;
switch (event) {
- case USB_EVENT_RESET:
- return;
case USB_EVENT_ADDRESS:
return;
case USB_EVENT_CONFIGURED:
@@ -285,17 +283,25 @@ static void usb_event(USBDriver *usbp, usbevent_t event) { chSysUnlockFromISR();
return;
+ case USB_EVENT_RESET:
+ /* Falls into.*/
case USB_EVENT_UNCONFIGURED:
- return;
+ /* Falls into.*/
case USB_EVENT_SUSPEND:
chSysLockFromISR();
/* Disconnection event on suspend.*/
- sduDisconnectI(&SDU1);
+ sduSuspendHookI(&SDU1);
chSysUnlockFromISR();
return;
case USB_EVENT_WAKEUP:
+ chSysLockFromISR();
+
+ /* Disconnection event on suspend.*/
+ sduWakeupHookI(&SDU1);
+
+ chSysUnlockFromISR();
return;
case USB_EVENT_STALLED:
return;
|