diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2016-11-03 12:43:09 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2016-11-03 12:43:09 +0000 |
commit | e1d8e5357927f0748fef013fb4bddebe781c60a8 (patch) | |
tree | 389cb8d73a94f53adc36d690fb8336d29cca55ea /testhal | |
parent | 13537cb7240240e6c7f915aa4d2aa6772034003b (diff) | |
download | ChibiOS-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')
-rw-r--r-- | testhal/STM32/STM32F0xx/USB_CDC/usbcfg.c | 14 | ||||
-rw-r--r-- | testhal/STM32/STM32F1xx/USB_CDC/usbcfg.c | 14 | ||||
-rw-r--r-- | testhal/STM32/STM32F2xx/USB_CDC/usbcfg.c | 14 | ||||
-rw-r--r-- | testhal/STM32/STM32F37x/USB_CDC/usbcfg.c | 14 | ||||
-rw-r--r-- | testhal/STM32/STM32F3xx/USB_CDC/usbcfg.c | 14 | ||||
-rw-r--r-- | testhal/STM32/STM32F3xx/USB_CDC_IAD/usbcfg.c | 17 | ||||
-rw-r--r-- | testhal/STM32/STM32F4xx/USB_CDC/usbcfg.c | 14 | ||||
-rw-r--r-- | testhal/STM32/STM32F4xx/USB_CDC_IAD/usbcfg.c | 17 | ||||
-rw-r--r-- | testhal/STM32/STM32F7xx/USB_CDC/usbcfg.c | 14 | ||||
-rw-r--r-- | testhal/STM32/STM32L4xx/USB_CDC/usbcfg.c | 14 |
10 files changed, 104 insertions, 42 deletions
diff --git a/testhal/STM32/STM32F0xx/USB_CDC/usbcfg.c b/testhal/STM32/STM32F0xx/USB_CDC/usbcfg.c index 1a46b170a..558334fb5 100644 --- a/testhal/STM32/STM32F0xx/USB_CDC/usbcfg.c +++ b/testhal/STM32/STM32F0xx/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/STM32F1xx/USB_CDC/usbcfg.c b/testhal/STM32/STM32F1xx/USB_CDC/usbcfg.c index 949321a59..db05bbd8a 100644 --- a/testhal/STM32/STM32F1xx/USB_CDC/usbcfg.c +++ b/testhal/STM32/STM32F1xx/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/STM32F2xx/USB_CDC/usbcfg.c b/testhal/STM32/STM32F2xx/USB_CDC/usbcfg.c index 949321a59..db05bbd8a 100644 --- a/testhal/STM32/STM32F2xx/USB_CDC/usbcfg.c +++ b/testhal/STM32/STM32F2xx/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/STM32F37x/USB_CDC/usbcfg.c b/testhal/STM32/STM32F37x/USB_CDC/usbcfg.c index 949321a59..db05bbd8a 100644 --- a/testhal/STM32/STM32F37x/USB_CDC/usbcfg.c +++ b/testhal/STM32/STM32F37x/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/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;
diff --git a/testhal/STM32/STM32F4xx/USB_CDC/usbcfg.c b/testhal/STM32/STM32F4xx/USB_CDC/usbcfg.c index 949321a59..db05bbd8a 100644 --- a/testhal/STM32/STM32F4xx/USB_CDC/usbcfg.c +++ b/testhal/STM32/STM32F4xx/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/STM32F4xx/USB_CDC_IAD/usbcfg.c b/testhal/STM32/STM32F4xx/USB_CDC_IAD/usbcfg.c index c6318049a..d1249b305 100644 --- a/testhal/STM32/STM32F4xx/USB_CDC_IAD/usbcfg.c +++ b/testhal/STM32/STM32F4xx/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;
diff --git a/testhal/STM32/STM32F7xx/USB_CDC/usbcfg.c b/testhal/STM32/STM32F7xx/USB_CDC/usbcfg.c index e0c0d853b..bb05f43c8 100644 --- a/testhal/STM32/STM32F7xx/USB_CDC/usbcfg.c +++ b/testhal/STM32/STM32F7xx/USB_CDC/usbcfg.c @@ -267,8 +267,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:
@@ -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(&SDU2);
+ sduSuspendHookI(&SDU2);
chSysUnlockFromISR();
return;
case USB_EVENT_WAKEUP:
+ chSysLockFromISR();
+
+ /* Disconnection event on suspend.*/
+ sduWakeupHookI(&SDU2);
+
+ chSysUnlockFromISR();
return;
case USB_EVENT_STALLED:
return;
diff --git a/testhal/STM32/STM32L4xx/USB_CDC/usbcfg.c b/testhal/STM32/STM32L4xx/USB_CDC/usbcfg.c index 949321a59..db05bbd8a 100644 --- a/testhal/STM32/STM32L4xx/USB_CDC/usbcfg.c +++ b/testhal/STM32/STM32L4xx/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;
|