diff options
Diffstat (limited to 'testhal/STM32/STM32F7xx/USB_CDC')
-rw-r--r-- | testhal/STM32/STM32F7xx/USB_CDC/usbcfg.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/testhal/STM32/STM32F7xx/USB_CDC/usbcfg.c b/testhal/STM32/STM32F7xx/USB_CDC/usbcfg.c index 73ada5cc0..968fd6724 100644 --- a/testhal/STM32/STM32F7xx/USB_CDC/usbcfg.c +++ b/testhal/STM32/STM32F7xx/USB_CDC/usbcfg.c @@ -284,6 +284,12 @@ static void usb_event(USBDriver *usbp, usbevent_t event) { chSysUnlockFromISR();
return;
case USB_EVENT_SUSPEND:
+ chSysLockFromISR();
+
+ /* Disconnection event on suspend.*/
+ sduDisconnectI(&SDU2);
+
+ chSysUnlockFromISR();
return;
case USB_EVENT_WAKEUP:
return;
|