From e98498a823f5b8ed52b7561403b0fdb106bb5dbe Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Wed, 19 Jan 2022 11:01:55 +0100 Subject: [PATCH] Add uart0 to user selection Add uart0 to user selection (#10203) --- lib/default/TasmotaSerial-3.4.0/src/TasmotaSerial.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/default/TasmotaSerial-3.4.0/src/TasmotaSerial.cpp b/lib/default/TasmotaSerial-3.4.0/src/TasmotaSerial.cpp index 5cd0614fe..eddc09fc0 100644 --- a/lib/default/TasmotaSerial-3.4.0/src/TasmotaSerial.cpp +++ b/lib/default/TasmotaSerial-3.4.0/src/TasmotaSerial.cpp @@ -134,7 +134,8 @@ bool TasmotaSerial::begin(uint32_t speed, uint32_t config) { } #endif // ESP8266 #ifdef ESP32 - if (tasmota_serial_index > 0) { // We only support UART1 and UART2 and keep UART0 for debugging +// if (tasmota_serial_index > 0) { // We only support UART1 and UART2 and keep UART0 for debugging + if (tasmota_serial_index >= 0) { // We prefer UART1 and UART2 and keep UART0 for debugging m_uart = tasmota_serial_index; tasmota_serial_index--; TSerial = new HardwareSerial(m_uart); @@ -192,7 +193,8 @@ bool TasmotaSerial::hardwareSerial(void) { return m_hardserial; #endif // ESP8266 #ifdef ESP32 - return false; // On ESP32 do not mess with Serial0 buffers +// return false; // On ESP32 do not mess with Serial0 buffers + return (0 == m_uart); // We prefer UART1 and UART2 and keep UART0 for debugging #endif // ESP32 }