aboutsummaryrefslogtreecommitdiffstats
path: root/testex/STM32
diff options
context:
space:
mode:
Diffstat (limited to 'testex/STM32')
-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;