File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -514,11 +514,16 @@ uart_t *uartBegin(
514
514
}
515
515
516
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 );
517
+ if (retCode ) {
518
+ if (inverted ) {
519
+ // 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
+ // invert signal for both Rx and Tx
523
+ retCode &= ESP_OK == uart_set_line_inverse (uart_nr , UART_SIGNAL_INV_DISABLE );
524
+ }
520
525
}
521
-
526
+ // if all fine, set internal parameters
522
527
if (retCode ) {
523
528
uart -> _baudrate = baudrate ;
524
529
uart -> _config = config ;
You can’t perform that action at this time.
0 commit comments