diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-08-19 15:07:47 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-08-19 15:07:47 +0000 |
commit | a042a8234acfdce62f65a5c72112f3256fade060 (patch) | |
tree | fab52fdade992466c216926e26f869d4d50f4fe3 /testhal/STM32F30x/EXT/main.c | |
parent | 79ad42bc2b8e9013d0a02a9d758fa8af36322b27 (diff) | |
download | ChibiOS-a042a8234acfdce62f65a5c72112f3256fade060.tar.gz ChibiOS-a042a8234acfdce62f65a5c72112f3256fade060.tar.bz2 ChibiOS-a042a8234acfdce62f65a5c72112f3256fade060.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6183 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/STM32F30x/EXT/main.c')
-rw-r--r-- | testhal/STM32F30x/EXT/main.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/testhal/STM32F30x/EXT/main.c b/testhal/STM32F30x/EXT/main.c index 9ef548d87..bd8b4359c 100644 --- a/testhal/STM32F30x/EXT/main.c +++ b/testhal/STM32F30x/EXT/main.c @@ -25,19 +25,20 @@ static void led5off(void *arg) { /* Triggered when the button is pressed or released. The LED5 is set to ON.*/
static void extcb1(EXTDriver *extp, expchannel_t channel) {
- static VirtualTimer vt4;
+ static virtual_timer_t vt4;
(void)extp;
(void)channel;
palSetPad(GPIOE, GPIOE_LED10_RED);
- chSysLockFromIsr();
- if (chVTIsArmedI(&vt4))
- chVTResetI(&vt4);
+ chSysLockFromISR();
+
+ /* Timer reset, if still active.*/
+ chVTResetI(&vt4);
/* LED4 set to OFF after 200mS.*/
chVTSetI(&vt4, MS2ST(200), led5off, NULL);
- chSysUnlockFromIsr();
+ chSysUnlockFromISR();
}
static const EXTConfig extcfg = {
|