aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/KINETIS/TEENSY3_x
diff options
context:
space:
mode:
Diffstat (limited to 'testhal/KINETIS/TEENSY3_x')
-rw-r--r--testhal/KINETIS/TEENSY3_x/ADC/chconf.h1
-rw-r--r--testhal/KINETIS/TEENSY3_x/ADC/main.c6
-rw-r--r--testhal/KINETIS/TEENSY3_x/EEPROM_EMU/chconf.h1
-rw-r--r--testhal/KINETIS/TEENSY3_x/EXT/chconf.h1
-rw-r--r--testhal/KINETIS/TEENSY3_x/EXT/main.c2
-rw-r--r--testhal/KINETIS/TEENSY3_x/GPT/chconf.h1
-rw-r--r--testhal/KINETIS/TEENSY3_x/PWM/chconf.h1
-rw-r--r--testhal/KINETIS/TEENSY3_x/SERIAL/chconf.h1
-rw-r--r--testhal/KINETIS/TEENSY3_x/SERIAL/main.c2
-rw-r--r--testhal/KINETIS/TEENSY3_x/USB_SERIAL/chconf.h1
-rw-r--r--testhal/KINETIS/TEENSY3_x/USB_SERIAL/usbcfg.c14
11 files changed, 23 insertions, 8 deletions
diff --git a/testhal/KINETIS/TEENSY3_x/ADC/chconf.h b/testhal/KINETIS/TEENSY3_x/ADC/chconf.h
index caae0c2..029e4ec 100644
--- a/testhal/KINETIS/TEENSY3_x/ADC/chconf.h
+++ b/testhal/KINETIS/TEENSY3_x/ADC/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/TEENSY3_x/ADC/main.c b/testhal/KINETIS/TEENSY3_x/ADC/main.c
index 7a2dc3a..09c3921 100644
--- a/testhal/KINETIS/TEENSY3_x/ADC/main.c
+++ b/testhal/KINETIS/TEENSY3_x/ADC/main.c
@@ -68,11 +68,11 @@ static void adc_end_cb(ADCDriver *adcp, adcsample_t *buffer, size_t n) {
chSysLockFromISR();
chVTResetI(&vt);
if (temp < 19000) {
- chVTSetI(&vt, MS2ST(10), ledoff, NULL);
+ chVTSetI(&vt, TIME_MS2I(10), ledoff, NULL);
} else if (temp > 28000) {
- chVTSetI(&vt, MS2ST(20), ledoff, NULL);
+ chVTSetI(&vt, TIME_MS2I(20), ledoff, NULL);
} else {
- chVTSetI(&vt, MS2ST(40), ledoff, NULL);
+ chVTSetI(&vt, TIME_MS2I(40), ledoff, NULL);
}
chSysUnlockFromISR();
}
diff --git a/testhal/KINETIS/TEENSY3_x/EEPROM_EMU/chconf.h b/testhal/KINETIS/TEENSY3_x/EEPROM_EMU/chconf.h
index ea87df8..3bb57de 100644
--- a/testhal/KINETIS/TEENSY3_x/EEPROM_EMU/chconf.h
+++ b/testhal/KINETIS/TEENSY3_x/EEPROM_EMU/chconf.h
@@ -29,6 +29,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/KINETIS/TEENSY3_x/EXT/chconf.h b/testhal/KINETIS/TEENSY3_x/EXT/chconf.h
index 0389bed..0be6605 100644
--- a/testhal/KINETIS/TEENSY3_x/EXT/chconf.h
+++ b/testhal/KINETIS/TEENSY3_x/EXT/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/TEENSY3_x/EXT/main.c b/testhal/KINETIS/TEENSY3_x/EXT/main.c
index 3903897..f46d49c 100644
--- a/testhal/KINETIS/TEENSY3_x/EXT/main.c
+++ b/testhal/KINETIS/TEENSY3_x/EXT/main.c
@@ -31,7 +31,7 @@ static void extcb1(EXTDriver *extp, expchannel_t channel) {
chSysLockFromISR();
chVTResetI(&vt);
/* LED set to OFF after 500mS.*/
- chVTSetI(&vt, MS2ST(500), ledoff, NULL);
+ chVTSetI(&vt, TIME_MS2I(500), ledoff, NULL);
chSysUnlockFromISR();
}
diff --git a/testhal/KINETIS/TEENSY3_x/GPT/chconf.h b/testhal/KINETIS/TEENSY3_x/GPT/chconf.h
index b2ed194..93ba7b8 100644
--- a/testhal/KINETIS/TEENSY3_x/GPT/chconf.h
+++ b/testhal/KINETIS/TEENSY3_x/GPT/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/TEENSY3_x/PWM/chconf.h b/testhal/KINETIS/TEENSY3_x/PWM/chconf.h
index dda26e1..a661f7e 100644
--- a/testhal/KINETIS/TEENSY3_x/PWM/chconf.h
+++ b/testhal/KINETIS/TEENSY3_x/PWM/chconf.h
@@ -29,6 +29,7 @@
#define _CHCONF_H_
#define _CHIBIOS_RT_CONF_
+#define _CHIBIOS_RT_CONF_VER_5_0_
/*===========================================================================*/
/**
diff --git a/testhal/KINETIS/TEENSY3_x/SERIAL/chconf.h b/testhal/KINETIS/TEENSY3_x/SERIAL/chconf.h
index 95b505a..27ed81c 100644
--- a/testhal/KINETIS/TEENSY3_x/SERIAL/chconf.h
+++ b/testhal/KINETIS/TEENSY3_x/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/TEENSY3_x/SERIAL/main.c b/testhal/KINETIS/TEENSY3_x/SERIAL/main.c
index 722a398..66b21e0 100644
--- a/testhal/KINETIS/TEENSY3_x/SERIAL/main.c
+++ b/testhal/KINETIS/TEENSY3_x/SERIAL/main.c
@@ -26,7 +26,7 @@ static THD_FUNCTION(thSerEcho, arg)
while (!chThdShouldTerminateX())
{
- chEvtWaitOneTimeout(EVENT_MASK(1), MS2ST(10));
+ chEvtWaitOneTimeout(EVENT_MASK(1), TIME_MS2I(10));
flags = chEvtGetAndClearFlags(&elSerData);
if (flags & CHN_INPUT_AVAILABLE)
{
diff --git a/testhal/KINETIS/TEENSY3_x/USB_SERIAL/chconf.h b/testhal/KINETIS/TEENSY3_x/USB_SERIAL/chconf.h
index 7d9ace3..6dbecb5 100644
--- a/testhal/KINETIS/TEENSY3_x/USB_SERIAL/chconf.h
+++ b/testhal/KINETIS/TEENSY3_x/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/TEENSY3_x/USB_SERIAL/usbcfg.c b/testhal/KINETIS/TEENSY3_x/USB_SERIAL/usbcfg.c
index 3093640..0ec1c62 100644
--- a/testhal/KINETIS/TEENSY3_x/USB_SERIAL/usbcfg.c
+++ b/testhal/KINETIS/TEENSY3_x/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;