aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32/STM32F3xx
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2016-11-03 12:43:09 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2016-11-03 12:43:09 +0000
commite1d8e5357927f0748fef013fb4bddebe781c60a8 (patch)
tree389cb8d73a94f53adc36d690fb8336d29cca55ea /testhal/STM32/STM32F3xx
parent13537cb7240240e6c7f915aa4d2aa6772034003b (diff)
downloadChibiOS-e1d8e5357927f0748fef013fb4bddebe781c60a8.tar.gz
ChibiOS-e1d8e5357927f0748fef013fb4bddebe781c60a8.tar.bz2
ChibiOS-e1d8e5357927f0748fef013fb4bddebe781c60a8.zip
Tentative USB suspend fix.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9898 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/STM32/STM32F3xx')
-rw-r--r--testhal/STM32/STM32F3xx/USB_CDC/usbcfg.c14
-rw-r--r--testhal/STM32/STM32F3xx/USB_CDC_IAD/usbcfg.c17
2 files changed, 22 insertions, 9 deletions
diff --git a/testhal/STM32/STM32F3xx/USB_CDC/usbcfg.c b/testhal/STM32/STM32F3xx/USB_CDC/usbcfg.c
index 949321a59..db05bbd8a 100644
--- a/testhal/STM32/STM32F3xx/USB_CDC/usbcfg.c
+++ b/testhal/STM32/STM32F3xx/USB_CDC/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;
diff --git a/testhal/STM32/STM32F3xx/USB_CDC_IAD/usbcfg.c b/testhal/STM32/STM32F3xx/USB_CDC_IAD/usbcfg.c
index c265a9fd6..9559e1f43 100644
--- a/testhal/STM32/STM32F3xx/USB_CDC_IAD/usbcfg.c
+++ b/testhal/STM32/STM32F3xx/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;