aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32F1xx/EXT/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'testhal/STM32F1xx/EXT/main.c')
-rw-r--r--testhal/STM32F1xx/EXT/main.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/testhal/STM32F1xx/EXT/main.c b/testhal/STM32F1xx/EXT/main.c
index e0fcd896c..1ca4260d0 100644
--- a/testhal/STM32F1xx/EXT/main.c
+++ b/testhal/STM32F1xx/EXT/main.c
@@ -17,7 +17,7 @@
#include "ch.h"
#include "hal.h"
-static VirtualTimer vt;
+static virtual_timer_t vt;
/* LED set to OFF after 200mS.*/
static void ledoff(void *arg) {
@@ -32,10 +32,9 @@ static void extcb1(EXTDriver *extp, expchannel_t channel) {
(void)extp;
(void)channel;
palClearPad(GPIOC, GPIOC_LED);
- chSysLockFromIsr();
- if (!chVTIsArmedI(&vt))
- chVTSetI(&vt, MS2ST(200), ledoff, NULL);
- chSysUnlockFromIsr();
+ chSysLockFromISR();
+ chVTSetI(&vt, MS2ST(200), ledoff, NULL);
+ chSysUnlockFromISR();
}
/* Triggered when the LED goes OFF.*/