aboutsummaryrefslogtreecommitdiffstats
path: root/demos/AVR/RT-TEENSY2-USB/usbcfg.c
diff options
context:
space:
mode:
Diffstat (limited to 'demos/AVR/RT-TEENSY2-USB/usbcfg.c')
-rw-r--r--demos/AVR/RT-TEENSY2-USB/usbcfg.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/demos/AVR/RT-TEENSY2-USB/usbcfg.c b/demos/AVR/RT-TEENSY2-USB/usbcfg.c
index a0c9ad258..5c20ee7d9 100644
--- a/demos/AVR/RT-TEENSY2-USB/usbcfg.c
+++ b/demos/AVR/RT-TEENSY2-USB/usbcfg.c
@@ -267,7 +267,15 @@ static void usb_event(USBDriver *usbp, usbevent_t event) {
chSysUnlockFromISR();
return;
+ case USB_EVENT_UNCONFIGURED:
+ return;
case USB_EVENT_SUSPEND:
+ chSysLockFromISR();
+
+ /* Disconnection event on suspend.*/
+ sduDisconnectI(&SDU1);
+
+ chSysUnlockFromISR();
return;
case USB_EVENT_WAKEUP:
return;