From d14d5b1aab236f0985a629cb0eb654a6d9d21ede Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Sat, 21 Nov 2015 17:12:29 +1100 Subject: [PATCH] stdin_uart_interrupt driver: Don't reset TX FIFO (loses output otherwise) Fixes bug in 'terminal' example where banner message didn't print on startup. Relates to #59. --- extras/stdin_uart_interrupt/stdin_uart_interrupt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extras/stdin_uart_interrupt/stdin_uart_interrupt.c b/extras/stdin_uart_interrupt/stdin_uart_interrupt.c index cee7b2f..38d2264 100644 --- a/extras/stdin_uart_interrupt/stdin_uart_interrupt.c +++ b/extras/stdin_uart_interrupt/stdin_uart_interrupt.c @@ -99,10 +99,10 @@ static void uart0_rx_init(void) _xt_isr_attach(INUM_UART, uart0_rx_handler); _xt_isr_unmask(1 << INUM_UART); - // clear rx and tx fifo,not ready + // reset the rx fifo uint32_t conf = UART(UART0).CONF0; - UART(UART0).CONF0 = conf | UART_CONF0_RXFIFO_RESET | UART_CONF0_TXFIFO_RESET; - UART(UART0).CONF0 = conf & ~(UART_CONF0_RXFIFO_RESET | UART_CONF0_TXFIFO_RESET); + UART(UART0).CONF0 = conf | UART_CONF0_RXFIFO_RESET; + UART(UART0).CONF0 = conf & ~UART_CONF0_RXFIFO_RESET; // set rx fifo trigger UART(UART0).CONF1 |= (trig_lvl & UART_CONF1_RXFIFO_FULL_THRESHOLD_M) << UART_CONF1_RXFIFO_FULL_THRESHOLD_S;