diff options
Diffstat (limited to 'os/hal/ports/STM32')
-rw-r--r-- | os/hal/ports/STM32/LLD/USARTv2/hal_serial_lld.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/os/hal/ports/STM32/LLD/USARTv2/hal_serial_lld.c b/os/hal/ports/STM32/LLD/USARTv2/hal_serial_lld.c index b78b6c195..4b5f20836 100644 --- a/os/hal/ports/STM32/LLD/USARTv2/hal_serial_lld.c +++ b/os/hal/ports/STM32/LLD/USARTv2/hal_serial_lld.c @@ -334,11 +334,12 @@ static void serve_interrupt(SerialDriver *sdp) { }
/* Physical transmission end.*/
- if (isr & USART_ISR_TC) {
+ if ((cr1 & USART_CR1_TCIE) && (isr & USART_ISR_TC)) {
osalSysLockFromISR();
- if (oqIsEmptyI(&sdp->oqueue))
+ if (oqIsEmptyI(&sdp->oqueue)) {
chnAddFlagsI(sdp, CHN_TRANSMISSION_END);
- u->CR1 = cr1 & ~USART_CR1_TCIE;
+ u->CR1 = cr1 & ~USART_CR1_TCIE;
+ }
osalSysUnlockFromISR();
}
}
|