From 83398f60119bec102ecc7823b2a367106cddd501 Mon Sep 17 00:00:00 2001 From: Christopher Pascoe Date: Mon, 28 Dec 2015 16:21:22 -0500 Subject: [PATCH] Don't bother testing isRxEnabled() on UART1 - it is always false. --- cores/esp8266/HardwareSerial.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/cores/esp8266/HardwareSerial.cpp b/cores/esp8266/HardwareSerial.cpp index 0cddc2ad2..800d021fe 100644 --- a/cores/esp8266/HardwareSerial.cpp +++ b/cores/esp8266/HardwareSerial.cpp @@ -133,13 +133,7 @@ void ICACHE_RAM_ATTR uart_interrupt_handler(uart_t* uart) { } // -------------- UART 1 -------------- - - if(Serial1.isRxEnabled()) { - while(U1IS & (1 << UIFF)) { - Serial1._rx_complete_irq((char) (U1F & 0xff)); - U1IC = (1 << UIFF); - } - } + // Note: only TX is supported on UART 1. if(Serial1.isTxEnabled()) { if(U1IS & (1 << UIFE)) { U1IC = (1 << UIFE); @@ -294,6 +288,7 @@ uart_t* uart_init(int uart_nr, int baudrate, byte config, byte mode) { IOSWAP &= ~(1 << IOSWAPU0); break; case UART1: + // Note: uart_interrupt_handler does not support RX on UART 1. uart->rxEnabled = false; uart->txEnabled = (mode != SERIAL_RX_ONLY); uart->rxPin = 255;