Improved TC handling in STM32 USART drivers.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11497 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
Giovanni Di Sirio 2018-02-16 07:54:12 +00:00
parent ab87baa16a
commit dedfd49dec
1 changed files with 4 additions and 3 deletions

View File

@ -334,11 +334,12 @@ static void serve_interrupt(SerialDriver *sdp) {
} }
/* Physical transmission end.*/ /* Physical transmission end.*/
if (isr & USART_ISR_TC) { if ((cr1 & USART_CR1_TCIE) && (isr & USART_ISR_TC)) {
osalSysLockFromISR(); osalSysLockFromISR();
if (oqIsEmptyI(&sdp->oqueue)) if (oqIsEmptyI(&sdp->oqueue)) {
chnAddFlagsI(sdp, CHN_TRANSMISSION_END); chnAddFlagsI(sdp, CHN_TRANSMISSION_END);
u->CR1 = cr1 & ~USART_CR1_TCIE; u->CR1 = cr1 & ~USART_CR1_TCIE;
}
osalSysUnlockFromISR(); osalSysUnlockFromISR();
} }
} }