serial.c: make sure to read incoming characters even if we don't

have space to store them.
This commit is contained in:
Markus Hitter 2010-10-04 15:51:55 +02:00
parent f56e121473
commit fb53c2c0a8
1 changed files with 6 additions and 0 deletions

View File

@ -82,6 +82,12 @@ ISR(USART0_RX_vect)
{
if (buf_canwrite(rx))
buf_push(rx, UDR0);
else {
uint8_t trash;
// not reading the character makes the interrupt logic to swamp us with retries, so better read it and throw it away
trash = UDR0;
}
}
#ifdef USART_UDRE_vect