aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32/STM32F4xx
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2015-09-08 13:36:30 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2015-09-08 13:36:30 +0000
commit98bb7fb5df434b95253c5949444ee2dcff3a53b3 (patch)
tree8a2e66cf00718d14da5bbd4e1f6b446612cd08f0 /testhal/STM32/STM32F4xx
parente5833b6a09786844ae09f389d768accec9678026 (diff)
downloadChibiOS-98bb7fb5df434b95253c5949444ee2dcff3a53b3.tar.gz
ChibiOS-98bb7fb5df434b95253c5949444ee2dcff3a53b3.tar.bz2
ChibiOS-98bb7fb5df434b95253c5949444ee2dcff3a53b3.zip
Update USB demos with latest changes.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8288 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/STM32/STM32F4xx')
-rw-r--r--testhal/STM32/STM32F4xx/USB_CDC/Makefile2
-rw-r--r--testhal/STM32/STM32F4xx/USB_CDC/usbcfg.c6
-rw-r--r--testhal/STM32/STM32F4xx/USB_CDC_IAD/Makefile2
-rw-r--r--testhal/STM32/STM32F4xx/USB_CDC_IAD/usbcfg.c7
4 files changed, 15 insertions, 2 deletions
diff --git a/testhal/STM32/STM32F4xx/USB_CDC/Makefile b/testhal/STM32/STM32F4xx/USB_CDC/Makefile
index a8a9dd05c..48f6caeb3 100644
--- a/testhal/STM32/STM32F4xx/USB_CDC/Makefile
+++ b/testhal/STM32/STM32F4xx/USB_CDC/Makefile
@@ -5,7 +5,7 @@
# Compiler options here.
ifeq ($(USE_OPT),)
- USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16
+ USE_OPT = -O0 -ggdb -fomit-frame-pointer -falign-functions=16
endif
# C specific options here (added to USE_OPT).
diff --git a/testhal/STM32/STM32F4xx/USB_CDC/usbcfg.c b/testhal/STM32/STM32F4xx/USB_CDC/usbcfg.c
index f825ec239..cfe1a7f5c 100644
--- a/testhal/STM32/STM32F4xx/USB_CDC/usbcfg.c
+++ b/testhal/STM32/STM32F4xx/USB_CDC/usbcfg.c
@@ -284,6 +284,12 @@ static void usb_event(USBDriver *usbp, usbevent_t event) {
chSysUnlockFromISR();
return;
case USB_EVENT_SUSPEND:
+ chSysLockFromISR();
+
+ /* Disconnection event on suspend.*/
+ sduDisconnectI(&SDU1);
+
+ chSysUnlockFromISR();
return;
case USB_EVENT_WAKEUP:
return;
diff --git a/testhal/STM32/STM32F4xx/USB_CDC_IAD/Makefile b/testhal/STM32/STM32F4xx/USB_CDC_IAD/Makefile
index 56351076a..d5e19d9a2 100644
--- a/testhal/STM32/STM32F4xx/USB_CDC_IAD/Makefile
+++ b/testhal/STM32/STM32F4xx/USB_CDC_IAD/Makefile
@@ -5,7 +5,7 @@
# Compiler options here.
ifeq ($(USE_OPT),)
- USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16
+ USE_OPT = -O0 -ggdb -fomit-frame-pointer -falign-functions=16
endif
# C specific options here (added to USE_OPT).
diff --git a/testhal/STM32/STM32F4xx/USB_CDC_IAD/usbcfg.c b/testhal/STM32/STM32F4xx/USB_CDC_IAD/usbcfg.c
index 5abf0f520..873bea31e 100644
--- a/testhal/STM32/STM32F4xx/USB_CDC_IAD/usbcfg.c
+++ b/testhal/STM32/STM32F4xx/USB_CDC_IAD/usbcfg.c
@@ -394,6 +394,13 @@ static void usb_event(USBDriver *usbp, usbevent_t event) {
chSysUnlockFromISR();
return;
case USB_EVENT_SUSPEND:
+ chSysLockFromISR();
+
+ /* Disconnection event on suspend.*/
+ sduDisconnectI(&SDU1);
+ sduDisconnectI(&SDU2);
+
+ chSysUnlockFromISR();
return;
case USB_EVENT_WAKEUP:
return;