From f18931b14ea61c393c65d2edd1de0ce709fc0f28 Mon Sep 17 00:00:00 2001 From: mikee47 Date: Sun, 31 Jan 2021 22:12:57 +0000 Subject: [PATCH] Fix bug in `smg_uart_set_tx()` Sets pin on wrong uart --- Sming/Arch/Esp8266/Components/driver/uart.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sming/Arch/Esp8266/Components/driver/uart.cpp b/Sming/Arch/Esp8266/Components/driver/uart.cpp index e6c50b94fc..22114d3818 100644 --- a/Sming/Arch/Esp8266/Components/driver/uart.cpp +++ b/Sming/Arch/Esp8266/Components/driver/uart.cpp @@ -910,9 +910,9 @@ void smg_uart_swap(smg_uart_t* uart, int tx_pin) bool smg_uart_set_tx(smg_uart_t* uart, int tx_pin) { if(uart != nullptr && uart->uart_nr == UART0 && smg_uart_tx_enabled(uart)) { - uart1_pin_restore(uart->tx_pin); + uart0_pin_restore(uart->tx_pin); uart->tx_pin = (tx_pin == 2) ? 2 : 1; - uart1_pin_select(uart->tx_pin); + uart0_pin_select(uart->tx_pin); return true; }