diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-08-20 14:49:49 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-08-20 14:49:49 +0000 |
commit | 371ef2afb5b7045d8293dd5a393a7783b025f8a8 (patch) | |
tree | d28a31a6d32d6d02cead54a8438556235635f0d6 /testhal/STM32F0xx/UART/main.c | |
parent | 8d0dc4bfd67857f376a2aa67424e9e8697342025 (diff) | |
download | ChibiOS-371ef2afb5b7045d8293dd5a393a7783b025f8a8.tar.gz ChibiOS-371ef2afb5b7045d8293dd5a393a7783b025f8a8.tar.bz2 ChibiOS-371ef2afb5b7045d8293dd5a393a7783b025f8a8.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6191 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/STM32F0xx/UART/main.c')
-rw-r--r-- | testhal/STM32F0xx/UART/main.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/testhal/STM32F0xx/UART/main.c b/testhal/STM32F0xx/UART/main.c index aa52aeb77..9df75bb9d 100644 --- a/testhal/STM32F0xx/UART/main.c +++ b/testhal/STM32F0xx/UART/main.c @@ -17,15 +17,15 @@ #include "ch.h"
#include "hal.h"
-static VirtualTimer vt1, vt2;
+static virtual_timer_t vt1, vt2;
static void restart(void *p) {
(void)p;
- chSysLockFromIsr();
+ chSysLockFromISR();
uartStartSendI(&UARTD1, 14, "Hello World!\r\n");
- chSysUnlockFromIsr();
+ chSysUnlockFromISR();
}
static void ledoff(void *p) {
@@ -51,11 +51,10 @@ static void txend2(UARTDriver *uartp) { (void)uartp;
palClearPad(GPIOC, GPIOC_LED4);
- chSysLockFromIsr();
- if (chVTIsArmedI(&vt1))
- chVTResetI(&vt1);
+ chSysLockFromISR();
+ chVTResetI(&vt1);
chVTSetI(&vt1, MS2ST(5000), restart, NULL);
- chSysUnlockFromIsr();
+ chSysUnlockFromISR();
}
/*
@@ -78,11 +77,10 @@ static void rxchar(UARTDriver *uartp, uint16_t c) { (void)c;
/* Flashing the LED each time a character is received.*/
palSetPad(GPIOC, GPIOC_LED4);
- chSysLockFromIsr();
- if (chVTIsArmedI(&vt2))
- chVTResetI(&vt2);
+ chSysLockFromISR();
+ chVTResetI(&vt2);
chVTSetI(&vt2, MS2ST(200), ledoff, NULL);
- chSysUnlockFromIsr();
+ chSysUnlockFromISR();
}
/*
|