aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32
diff options
context:
space:
mode:
Diffstat (limited to 'testhal/STM32')
-rw-r--r--testhal/STM32/UART/main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/testhal/STM32/UART/main.c b/testhal/STM32/UART/main.c
index 1ba3ec336..ef862a981 100644
--- a/testhal/STM32/UART/main.c
+++ b/testhal/STM32/UART/main.c
@@ -25,7 +25,9 @@ static VirtualTimer vt1, vt2;
static void restart(void *p) {
(void)p;
- uartStartSend(&UARTD2, 14, "Hello World!\r\n");
+ chSysLockFromIsr();
+ uartStartSendI(&UARTD2, 14, "Hello World!\r\n");
+ chSysUnlockFromIsr();
}
static void ledoff(void *p) {
@@ -50,6 +52,8 @@ static void txend2(void) {
palSetPad(IOPORT3, GPIOC_LED);
chSysLockFromIsr();
+ if (chVTIsArmedI(&vt1))
+ chVTResetI(&vt1);
chVTSetI(&vt1, MS2ST(5000), restart, NULL);
chSysUnlockFromIsr();
}