aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/KINETIS/MCHCK
diff options
context:
space:
mode:
Diffstat (limited to 'testhal/KINETIS/MCHCK')
-rw-r--r--testhal/KINETIS/MCHCK/BOOTLOADER/chconf.h1
-rw-r--r--testhal/KINETIS/MCHCK/PWM/chconf.h1
-rw-r--r--testhal/KINETIS/MCHCK/USB_SERIAL/chconf.h1
-rw-r--r--testhal/KINETIS/MCHCK/USB_SERIAL/usbcfg.c14
4 files changed, 14 insertions, 3 deletions
diff --git a/testhal/KINETIS/MCHCK/BOOTLOADER/chconf.h b/testhal/KINETIS/MCHCK/BOOTLOADER/chconf.h
index b2448a9..a185459 100644
--- a/testhal/KINETIS/MCHCK/BOOTLOADER/chconf.h
+++ b/testhal/KINETIS/MCHCK/BOOTLOADER/chconf.h
@@ -27,6 +27,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/KINETIS/MCHCK/PWM/chconf.h b/testhal/KINETIS/MCHCK/PWM/chconf.h
index 034c6cc..2f2938a 100644
--- a/testhal/KINETIS/MCHCK/PWM/chconf.h
+++ b/testhal/KINETIS/MCHCK/PWM/chconf.h
@@ -27,6 +27,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/KINETIS/MCHCK/USB_SERIAL/chconf.h b/testhal/KINETIS/MCHCK/USB_SERIAL/chconf.h
index 7371b49..22272b1 100644
--- a/testhal/KINETIS/MCHCK/USB_SERIAL/chconf.h
+++ b/testhal/KINETIS/MCHCK/USB_SERIAL/chconf.h
@@ -27,6 +27,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/KINETIS/MCHCK/USB_SERIAL/usbcfg.c b/testhal/KINETIS/MCHCK/USB_SERIAL/usbcfg.c
index 3093640..0ec1c62 100644
--- a/testhal/KINETIS/MCHCK/USB_SERIAL/usbcfg.c
+++ b/testhal/KINETIS/MCHCK/USB_SERIAL/usbcfg.c
@@ -262,8 +262,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:
@@ -280,15 +278,25 @@ static void usb_event(USBDriver *usbp, usbevent_t event) {
chSysUnlockFromISR();
return;
+ case USB_EVENT_RESET:
+ /* Falls into. */
+ case USB_EVENT_UNCONFIGURED:
+ /* 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;