mc1322x: flush the rx fifos when full
This commit is contained in:
parent
6355545ded
commit
758fc37307
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue