diff options
Diffstat (limited to 'testhal/STM32/STM32F4xx/USB_CDC_IAD/usbcfg.c')
-rw-r--r-- | testhal/STM32/STM32F4xx/USB_CDC_IAD/usbcfg.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/testhal/STM32/STM32F4xx/USB_CDC_IAD/usbcfg.c b/testhal/STM32/STM32F4xx/USB_CDC_IAD/usbcfg.c index c6318049a..d1249b305 100644 --- a/testhal/STM32/STM32F4xx/USB_CDC_IAD/usbcfg.c +++ b/testhal/STM32/STM32F4xx/USB_CDC_IAD/usbcfg.c @@ -373,8 +373,6 @@ static void usb_event(USBDriver *usbp, usbevent_t event) { extern SerialUSBDriver SDU2;
switch (event) {
- case USB_EVENT_RESET:
- return;
case USB_EVENT_ADDRESS:
return;
case USB_EVENT_CONFIGURED:
@@ -399,18 +397,27 @@ 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);
- sduDisconnectI(&SDU2);
+ sduSuspendHookI(&SDU1);
+ sduSuspendHookI(&SDU2);
chSysUnlockFromISR();
return;
case USB_EVENT_WAKEUP:
+ chSysLockFromISR();
+
+ /* Disconnection event on suspend.*/
+ sduWakeupHookI(&SDU1);
+ sduWakeupHookI(&SDU2);
+
+ chSysUnlockFromISR();
return;
case USB_EVENT_STALLED:
return;
|