From fb6cc96951f14bdb059e37ffde09b9b73a5a756f Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 1 Apr 2016 14:30:47 +0300 Subject: [PATCH] esp8266/uart: Comment out old, unused rx buffering code. This was originally used for non-event based REPL processing. Then it was unused when event-based processing was activated. But now that event based is disabled, and non-event based is back, there has been new ring buffer code to process the chars. --- esp8266/uart.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/esp8266/uart.c b/esp8266/uart.c index bfc380ae4a..ed5e1d9979 100644 --- a/esp8266/uart.c +++ b/esp8266/uart.c @@ -19,18 +19,22 @@ #include "user_interface.h" #include "esp_mphal.h" -#define RX_BUF_SIZE (256) #define UART_REPL UART0 // UartDev is defined and initialized in rom code. extern UartDevice UartDev; +/* unused // circular buffer for RX buffering +#define RX_BUF_SIZE (256) static uint16_t rx_buf_in; static uint16_t rx_buf_out; static uint8_t rx_buf[RX_BUF_SIZE]; +*/ +#if MICROPY_REPL_EVENT_DRIVEN static os_event_t uart_evt_queue[16]; +#endif static void uart0_rx_intr_handler(void *para); @@ -83,9 +87,11 @@ static void ICACHE_FLASH_ATTR uart_config(uint8 uart_no) { // enable rx_interrupt SET_PERI_REG_MASK(UART_INT_ENA(uart_no), UART_RXFIFO_FULL_INT_ENA); + /* unused // init RX buffer rx_buf_in = 0; rx_buf_out = 0; + */ } /****************************************************************************** @@ -184,6 +190,7 @@ static void uart0_rx_intr_handler(void *para) { } } +/* unused int uart0_rx(void) { if (rx_buf_out != rx_buf_in) { int chr = rx_buf[rx_buf_out]; @@ -193,6 +200,7 @@ int uart0_rx(void) { return -1; } } +*/ int uart_rx_one_char(uint8 uart_no) { if (READ_PERI_REG(UART_STATUS(uart_no)) & (UART_RXFIFO_CNT << UART_RXFIFO_CNT_S)) {