From e1d8e5357927f0748fef013fb4bddebe781c60a8 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 3 Nov 2016 12:43:09 +0000 Subject: Tentative USB suspend fix. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9898 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/STM32/RT-STM32F429-DISCOVERY/usbcfg.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'demos/STM32/RT-STM32F429-DISCOVERY/usbcfg.c') diff --git a/demos/STM32/RT-STM32F429-DISCOVERY/usbcfg.c b/demos/STM32/RT-STM32F429-DISCOVERY/usbcfg.c index 26ec6df67..5121b03aa 100644 --- a/demos/STM32/RT-STM32F429-DISCOVERY/usbcfg.c +++ b/demos/STM32/RT-STM32F429-DISCOVERY/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; -- cgit v1.2.3