Skip to content

Commit

Permalink
uart_isr: fix interrupts clear
Browse files Browse the repository at this point in the history
  • Loading branch information
enjoy-digital authored and Sebastien Bourdeauducq committed Oct 23, 2013
1 parent 833d7c7 commit e7c72a8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions software/libbase/uart.c
Expand Up @@ -33,18 +33,18 @@ void uart_isr(void)
if(stat & UART_EV_RX) {
rx_buf[rx_produce] = uart_rxtx_read();
rx_produce = (rx_produce + 1) & UART_RINGBUFFER_MASK_RX;
uart_ev_pending_write(UART_EV_RX);
}

if(stat & UART_EV_TX) {
uart_ev_pending_write(UART_EV_TX);
if(tx_level > 0) {
uart_rxtx_write(tx_buf[tx_consume]);
tx_consume = (tx_consume + 1) & UART_RINGBUFFER_MASK_TX;
tx_level--;
} else
tx_cts = 1;
}

uart_ev_pending_write(stat);
}

/* Do not use in interrupt handlers! */
Expand Down

0 comments on commit e7c72a8

Please sign in to comment.