aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32F4xx/UART/main.c
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-05-07 08:11:03 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-05-07 08:11:03 +0000
commitbec915e05274a94f2b1a5e2443f04de826dd1f6e (patch)
treecec2044911766f5dc5a7bd8b8c9ffe0fe81734f8 /testhal/STM32F4xx/UART/main.c
parent4afa0b98dff9eac6a94c104acf900e15147d2da3 (diff)
parentb43c71424d201583822b26d13d11f7e3634cb515 (diff)
downloadChibiOS-bec915e05274a94f2b1a5e2443f04de826dd1f6e.tar.gz
ChibiOS-bec915e05274a94f2b1a5e2443f04de826dd1f6e.tar.bz2
ChibiOS-bec915e05274a94f2b1a5e2443f04de826dd1f6e.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@6916 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/STM32F4xx/UART/main.c')
-rw-r--r--testhal/STM32F4xx/UART/main.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/testhal/STM32F4xx/UART/main.c b/testhal/STM32F4xx/UART/main.c
index fcd6fa965..3f01dc1a1 100644
--- a/testhal/STM32F4xx/UART/main.c
+++ b/testhal/STM32F4xx/UART/main.c
@@ -17,7 +17,7 @@
#include "ch.h"
#include "hal.h"
-static VirtualTimer vt3, vt4, vt5;
+static virtual_timer_t vt3, vt4, vt5;
static const uint8_t message[] = "0123456789ABCDEF";
static uint8_t buffer[16];
@@ -56,11 +56,10 @@ static void txend2(UARTDriver *uartp) {
(void)uartp;
palSetPad(GPIOD, GPIOD_LED5);
- chSysLockFromIsr();
- if (chVTIsArmedI(&vt5))
- chVTResetI(&vt5);
+ chSysLockFromISR();
+ chVTResetI(&vt5);
chVTSetI(&vt5, MS2ST(200), led5off, NULL);
- chSysUnlockFromIsr();
+ chSysUnlockFromISR();
}
/*
@@ -83,11 +82,10 @@ static void rxchar(UARTDriver *uartp, uint16_t c) {
(void)c;
/* Flashing the LED each time a character is received.*/
palSetPad(GPIOD, GPIOD_LED4);
- chSysLockFromIsr();
- if (chVTIsArmedI(&vt4))
- chVTResetI(&vt4);
+ chSysLockFromISR();
+ chVTResetI(&vt4);
chVTSetI(&vt4, MS2ST(200), led4off, NULL);
- chSysUnlockFromIsr();
+ chSysUnlockFromISR();
}
/*
@@ -99,11 +97,10 @@ static void rxend(UARTDriver *uartp) {
/* Flashing the LED each time a character is received.*/
palSetPad(GPIOD, GPIOD_LED3);
- chSysLockFromIsr();
- if (chVTIsArmedI(&vt3))
- chVTResetI(&vt3);
+ chSysLockFromISR();
+ chVTResetI(&vt3);
chVTSetI(&vt3, MS2ST(200), led3off, NULL);
- chSysUnlockFromIsr();
+ chSysUnlockFromISR();
}
/*