From 2c928f2833afa53ec045adafb39d85b84685a2d8 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 29 Sep 2013 10:39:31 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6330 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- testhal/STM32F37x/UART/main.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'testhal/STM32F37x/UART/main.c') diff --git a/testhal/STM32F37x/UART/main.c b/testhal/STM32F37x/UART/main.c index 7b9577f8a..ddba3eed7 100644 --- a/testhal/STM32F37x/UART/main.c +++ b/testhal/STM32F37x/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(&UARTD2, 14, "Hello World!\r\n"); - chSysUnlockFromIsr(); + chSysUnlockFromISR(); } static void ledoff(void *p) { @@ -51,11 +51,10 @@ static void txend2(UARTDriver *uartp) { (void)uartp; palSetPad(GPIOC, GPIOC_LED1); - chSysLockFromIsr(); - if (chVTIsArmedI(&vt1)) - chVTResetI(&vt1); - chVTSetI(&vt1, MS2ST(5000), restart, NULL); - chSysUnlockFromIsr(); + chSysLockFromISR(); + chVTResetI(&vt1); + chVTDoSetI(&vt1, MS2ST(5000), restart, NULL); + chSysUnlockFromISR(); } /* @@ -78,11 +77,10 @@ static void rxchar(UARTDriver *uartp, uint16_t c) { (void)c; /* Flashing the LED each time a character is received.*/ palClearPad(GPIOC, GPIOC_LED1); - chSysLockFromIsr(); - if (chVTIsArmedI(&vt2)) - chVTResetI(&vt2); - chVTSetI(&vt2, MS2ST(200), ledoff, NULL); - chSysUnlockFromIsr(); + chSysLockFromISR(); + chVTResetI(&vt2); + chVTDoSetI(&vt2, MS2ST(200), ledoff, NULL); + chSysUnlockFromISR(); } /* -- cgit v1.2.3