Skip to content

Commit cd7d137

Browse files
committed
Per review.
1 parent 2e21484 commit cd7d137

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

cores/esp8266/uart.cpp

+2-9
Original file line numberDiff line numberDiff line change
@@ -830,18 +830,11 @@ uart_set_tx(uart_t* uart, int tx_pin)
830830
{
831831
return true;
832832
}
833-
else if (tx_pin == 2)
833+
else if (tx_pin == 1 || tx_pin == 2)
834834
{
835835
pinMode(uart->tx_pin, INPUT);
836836
uart->tx_pin = tx_pin;
837-
pinMode(uart->tx_pin, FUNCTION_4);
838-
return true;
839-
}
840-
else if (tx_pin != 2)
841-
{
842-
pinMode(uart->tx_pin, INPUT);
843-
uart->tx_pin = 1;
844-
pinMode(uart->tx_pin, SPECIAL);
837+
pinMode(uart->tx_pin, tx_pin == 1 ? SPECIAL : FUNCTION_4);
845838
return true;
846839
}
847840
}

0 commit comments

Comments
 (0)