git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7706 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
Giovanni Di Sirio 2015-03-01 09:18:26 +00:00
parent e068671a36
commit e6c4363ddb
1 changed files with 7 additions and 2 deletions

View File

@ -165,11 +165,16 @@ static void serve_interrupt(SerialDriver *sdp) {
/* Data available.*/
osalSysLockFromISR();
while (sr & USART_SR_RXNE) {
while (sr & (USART_SR_RXNE | USART_SR_ORE | USART_SR_NE | USART_SR_FE |
USART_SR_PE)) {
uint8_t b;
/* Error condition detection.*/
if (sr & (USART_SR_ORE | USART_SR_NE | USART_SR_FE | USART_SR_PE))
set_error(sdp, sr);
sdIncomingDataI(sdp, u->DR);
b = u->DR;
if (sr & USART_SR_RXNE)
sdIncomingDataI(sdp, b);
sr = u->SR;
}
osalSysUnlockFromISR();