Skip to content

Commit

Permalink
Fix bug in smg_uart_set_tx() (#2210)
Browse files Browse the repository at this point in the history
Sets pin on wrong uart
  • Loading branch information
mikee47 authored and slav-at-attachix committed Feb 1, 2021
1 parent 4b8f3bd commit 063bc7e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sming/Arch/Esp8266/Components/driver/uart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 063bc7e

Please sign in to comment.