diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2017-08-28 14:44:58 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2017-08-28 14:44:58 +0000 |
commit | 7006611bdc3ff9113cccb10b8f6e2102563f9ac3 (patch) | |
tree | 37db9e2f16ecd4d243fb2ebcb4b084cfe7a8d7ba /os/hal/ports/STM32 | |
parent | 6452f6f997d2fe9401d6eb5c463d0744055068e5 (diff) | |
download | ChibiOS-7006611bdc3ff9113cccb10b8f6e2102563f9ac3.tar.gz ChibiOS-7006611bdc3ff9113cccb10b8f6e2102563f9ac3.tar.bz2 ChibiOS-7006611bdc3ff9113cccb10b8f6e2102563f9ac3.zip |
Tentative fix for anomalous TC event from STM32 USARTv1 driver.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10503 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/ports/STM32')
-rw-r--r-- | os/hal/ports/STM32/LLD/USARTv1/hal_serial_lld.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/os/hal/ports/STM32/LLD/USARTv1/hal_serial_lld.c b/os/hal/ports/STM32/LLD/USARTv1/hal_serial_lld.c index bc4be0edd..b76c06ef5 100644 --- a/os/hal/ports/STM32/LLD/USARTv1/hal_serial_lld.c +++ b/os/hal/ports/STM32/LLD/USARTv1/hal_serial_lld.c @@ -213,12 +213,12 @@ static void serve_interrupt(SerialDriver *sdp) { }
/* Physical transmission end.*/
- if (sr & USART_SR_TC) {
+ if ((cr1 & USART_CR1_TCIE) && (sr & USART_SR_TC)) {
osalSysLockFromISR();
- if (oqIsEmptyI(&sdp->oqueue))
+ if (oqIsEmptyI(&sdp->oqueue)) {
chnAddFlagsI(sdp, CHN_TRANSMISSION_END);
- u->CR1 = cr1 & ~USART_CR1_TCIE;
- u->SR = ~USART_SR_TC;
+ u->CR1 = cr1 & ~USART_CR1_TCIE;
+ }
osalSysUnlockFromISR();
}
}
|