We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 337058a commit adae99fCopy full SHA for adae99f
cores/esp32/esp32-hal-uart.c
@@ -514,11 +514,16 @@ uart_t *uartBegin(
514
}
515
516
// Is it right or the idea is to swap rx and tx pins?
517
- if (retCode && inverted) {
518
- // invert signal for both Rx and Tx
519
- retCode &= ESP_OK == uart_set_line_inverse(uart_nr, UART_SIGNAL_TXD_INV | UART_SIGNAL_RXD_INV);
+ if (retCode) {
+ if (inverted) {
+ // invert signal for both Rx and Tx
520
+ retCode &= ESP_OK == uart_set_line_inverse(uart_nr, UART_SIGNAL_TXD_INV | UART_SIGNAL_RXD_INV);
521
+ } else {
522
523
+ retCode &= ESP_OK == uart_set_line_inverse(uart_nr, UART_SIGNAL_INV_DISABLE);
524
+ }
525
-
526
+ // if all fine, set internal parameters
527
if (retCode) {
528
uart->_baudrate = baudrate;
529
uart->_config = config;
0 commit comments