Skip to content

Commit fb6cc96

Browse files
dpgeorgepfalcon
authored andcommitted
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.
1 parent fc4c43a commit fb6cc96

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

esp8266/uart.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,22 @@
1919
#include "user_interface.h"
2020
#include "esp_mphal.h"
2121

22-
#define RX_BUF_SIZE (256)
2322
#define UART_REPL UART0
2423

2524
// UartDev is defined and initialized in rom code.
2625
extern UartDevice UartDev;
2726

27+
/* unused
2828
// circular buffer for RX buffering
29+
#define RX_BUF_SIZE (256)
2930
static uint16_t rx_buf_in;
3031
static uint16_t rx_buf_out;
3132
static uint8_t rx_buf[RX_BUF_SIZE];
33+
*/
3234

35+
#if MICROPY_REPL_EVENT_DRIVEN
3336
static os_event_t uart_evt_queue[16];
37+
#endif
3438

3539
static void uart0_rx_intr_handler(void *para);
3640

@@ -83,9 +87,11 @@ static void ICACHE_FLASH_ATTR uart_config(uint8 uart_no) {
8387
// enable rx_interrupt
8488
SET_PERI_REG_MASK(UART_INT_ENA(uart_no), UART_RXFIFO_FULL_INT_ENA);
8589

90+
/* unused
8691
// init RX buffer
8792
rx_buf_in = 0;
8893
rx_buf_out = 0;
94+
*/
8995
}
9096

9197
/******************************************************************************
@@ -184,6 +190,7 @@ static void uart0_rx_intr_handler(void *para) {
184190
}
185191
}
186192

193+
/* unused
187194
int uart0_rx(void) {
188195
if (rx_buf_out != rx_buf_in) {
189196
int chr = rx_buf[rx_buf_out];
@@ -193,6 +200,7 @@ int uart0_rx(void) {
193200
return -1;
194201
}
195202
}
203+
*/
196204

197205
int uart_rx_one_char(uint8 uart_no) {
198206
if (READ_PERI_REG(UART_STATUS(uart_no)) & (UART_RXFIFO_CNT << UART_RXFIFO_CNT_S)) {

0 commit comments

Comments
 (0)