aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--os/hal/ports/STM32/USARTv1/serial_lld.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/os/hal/ports/STM32/USARTv1/serial_lld.c b/os/hal/ports/STM32/USARTv1/serial_lld.c
index 89ac1187b..87be9bbb6 100644
--- a/os/hal/ports/STM32/USARTv1/serial_lld.c
+++ b/os/hal/ports/STM32/USARTv1/serial_lld.c
@@ -160,7 +160,7 @@ static void serve_interrupt(SerialDriver *sdp) {
osalSysLockFromISR();
chnAddFlagsI(sdp, SD_BREAK_DETECTED);
osalSysUnlockFromISR();
- u->SR &= ~USART_SR_LBD;
+ u->SR = ~USART_SR_LBD;
}
/* Data available.*/
@@ -193,8 +193,8 @@ static void serve_interrupt(SerialDriver *sdp) {
osalSysLockFromISR();
chnAddFlagsI(sdp, CHN_TRANSMISSION_END);
osalSysUnlockFromISR();
- u->CR1 = cr1 & ~USART_CR1_TCIE;
- u->SR &= ~USART_SR_TC;
+ u->CR1 = cr1 & ~(USART_CR1_TXEIE | USART_CR1_TCIE);
+ u->SR = ~USART_SR_TC;
}
}