summaryrefslogtreecommitdiffstatshomepage
path: root/esp8266
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-04-01 14:30:47 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-04-01 14:30:47 +0300
commitfb6cc96951f14bdb059e37ffde09b9b73a5a756f (patch)
tree7fed66d4e8ae6b10e4b9be8ecb8c2aeb1d82ca4c /esp8266
parentfc4c43a72eeca3e3aef00952e28d9e3552687241 (diff)
downloadmicropython-fb6cc96951f14bdb059e37ffde09b9b73a5a756f.tar.gz
micropython-fb6cc96951f14bdb059e37ffde09b9b73a5a756f.zip
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.
Diffstat (limited to 'esp8266')
-rw-r--r--esp8266/uart.c10
1 files changed, 9 insertions, 1 deletions
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)) {