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:
parent
ab87baa16a
commit
dedfd49dec
|
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue