From cd7d137774c885135d958834d4dee878bf8b935f Mon Sep 17 00:00:00 2001 From: "Dirk O. Kaar" Date: Sun, 4 Apr 2021 19:26:24 +0200 Subject: [PATCH] Per review. --- cores/esp8266/uart.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/cores/esp8266/uart.cpp b/cores/esp8266/uart.cpp index 4b7c189dd..de574d0be 100644 --- a/cores/esp8266/uart.cpp +++ b/cores/esp8266/uart.cpp @@ -830,18 +830,11 @@ uart_set_tx(uart_t* uart, int tx_pin) { return true; } - else if (tx_pin == 2) + else if (tx_pin == 1 || tx_pin == 2) { pinMode(uart->tx_pin, INPUT); uart->tx_pin = tx_pin; - pinMode(uart->tx_pin, FUNCTION_4); - return true; - } - else if (tx_pin != 2) - { - pinMode(uart->tx_pin, INPUT); - uart->tx_pin = 1; - pinMode(uart->tx_pin, SPECIAL); + pinMode(uart->tx_pin, tx_pin == 1 ? SPECIAL : FUNCTION_4); return true; } }