mc1322x: flush the rx fifos when full

This commit is contained in:
Mariano Alvira 2011-07-12 07:05:04 -04:00
parent 6355545ded
commit 758fc37307
2 changed files with 28 additions and 24 deletions

View file

@ -56,6 +56,8 @@ void uart1_isr(void) {
if (u1_rx_head != u1_rx_tail_next) {
u1_rx_buf[u1_rx_tail]= *UART1_UDATA;
u1_rx_tail = u1_rx_tail_next;
} else { //buffer is full, flush the fifo
while (*UART1_URXCON !=0) if (*UART1_UDATA);
}
}
return;

View file

@ -56,6 +56,8 @@ void uart2_isr(void) {
if (u2_rx_head != u2_rx_tail_next) {
u2_rx_buf[u2_rx_tail]= *UART2_UDATA;
u2_rx_tail = u2_rx_tail_next;
} else { //buffer is full, flush the fifo
while (*UART2_URXCON !=0) if (*UART2_UDATA);
}
}
return;