diff options
Diffstat (limited to 'demos/AVR/RT-PRO_MICRO')
-rw-r--r-- | demos/AVR/RT-PRO_MICRO/usbcfg.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/demos/AVR/RT-PRO_MICRO/usbcfg.c b/demos/AVR/RT-PRO_MICRO/usbcfg.c index 91b0207ab..851c576c4 100644 --- a/demos/AVR/RT-PRO_MICRO/usbcfg.c +++ b/demos/AVR/RT-PRO_MICRO/usbcfg.c @@ -282,8 +282,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: @@ -301,17 +299,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; |