serial.c: make sure to read incoming characters even if we don't
have space to store them.
This commit is contained in:
parent
f56e121473
commit
fb53c2c0a8
6
serial.c
6
serial.c
|
|
@ -82,6 +82,12 @@ ISR(USART0_RX_vect)
|
||||||
{
|
{
|
||||||
if (buf_canwrite(rx))
|
if (buf_canwrite(rx))
|
||||||
buf_push(rx, UDR0);
|
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
|
#ifdef USART_UDRE_vect
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue