aboutsummaryrefslogtreecommitdiffstats
path: root/testex
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 /testex
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 'testex')
-rw-r--r--testex/STM32/STM32F3xx/I2C-LSM303DLHC/usbcfg.c14
-rw-r--r--testex/STM32/STM32F3xx/SPI-L3GD20/usbcfg.c14
-rw-r--r--testex/STM32/STM32F4xx/I2C-LSM303DLHC/usbcfg.c14
-rw-r--r--testex/STM32/STM32F4xx/SPI-L3GD20/usbcfg.c14
-rw-r--r--testex/STM32/STM32F4xx/SPI-LIS302DL/usbcfg.c14
-rw-r--r--testex/STM32/STM32F4xx/SPI-LIS3DSH/usbcfg.c14
6 files changed, 60 insertions, 24 deletions
diff --git a/testex/STM32/STM32F3xx/I2C-LSM303DLHC/usbcfg.c b/testex/STM32/STM32F3xx/I2C-LSM303DLHC/usbcfg.c
index 949321a59..db05bbd8a 100644
--- a/testex/STM32/STM32F3xx/I2C-LSM303DLHC/usbcfg.c
+++ b/testex/STM32/STM32F3xx/I2C-LSM303DLHC/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/testex/STM32/STM32F3xx/SPI-L3GD20/usbcfg.c b/testex/STM32/STM32F3xx/SPI-L3GD20/usbcfg.c
index 949321a59..db05bbd8a 100644
--- a/testex/STM32/STM32F3xx/SPI-L3GD20/usbcfg.c
+++ b/testex/STM32/STM32F3xx/SPI-L3GD20/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/testex/STM32/STM32F4xx/I2C-LSM303DLHC/usbcfg.c b/testex/STM32/STM32F4xx/I2C-LSM303DLHC/usbcfg.c
index 949321a59..db05bbd8a 100644
--- a/testex/STM32/STM32F4xx/I2C-LSM303DLHC/usbcfg.c
+++ b/testex/STM32/STM32F4xx/I2C-LSM303DLHC/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/testex/STM32/STM32F4xx/SPI-L3GD20/usbcfg.c b/testex/STM32/STM32F4xx/SPI-L3GD20/usbcfg.c
index 949321a59..db05bbd8a 100644
--- a/testex/STM32/STM32F4xx/SPI-L3GD20/usbcfg.c
+++ b/testex/STM32/STM32F4xx/SPI-L3GD20/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/testex/STM32/STM32F4xx/SPI-LIS302DL/usbcfg.c b/testex/STM32/STM32F4xx/SPI-LIS302DL/usbcfg.c
index 949321a59..db05bbd8a 100644
--- a/testex/STM32/STM32F4xx/SPI-LIS302DL/usbcfg.c
+++ b/testex/STM32/STM32F4xx/SPI-LIS302DL/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/testex/STM32/STM32F4xx/SPI-LIS3DSH/usbcfg.c b/testex/STM32/STM32F4xx/SPI-LIS3DSH/usbcfg.c
index 949321a59..db05bbd8a 100644
--- a/testex/STM32/STM32F4xx/SPI-LIS3DSH/usbcfg.c
+++ b/testex/STM32/STM32F4xx/SPI-LIS3DSH/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;