Skip to content

Commit 5ae3886

Browse files
authored
Fixes UART MODBUS and Loopback issue (espressif#6133)
1 parent 1bbe61a commit 5ae3886

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

cores/esp32/esp32-hal-uart.c

+1-4
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,6 @@ uart_t* uartBegin(uint8_t uart_nr, uint32_t baudrate, uint32_t config, int8_t rx
153153
ESP_ERROR_CHECK(uart_set_line_inverse(uart_nr, UART_SIGNAL_TXD_INV | UART_SIGNAL_RXD_INV));
154154
}
155155

156-
// Set RS485 half duplex mode on UART. This shall force flush to wait up to sending all bits out
157-
ESP_ERROR_CHECK(uart_set_mode(uart_nr, UART_MODE_RS485_HALF_DUPLEX));
158-
159156
UART_MUTEX_UNLOCK();
160157

161158
uartFlush(uart);
@@ -306,7 +303,7 @@ void uartFlushTxOnly(uart_t* uart, bool txOnly)
306303
}
307304

308305
UART_MUTEX_LOCK();
309-
ESP_ERROR_CHECK(uart_wait_tx_done(uart->num, portMAX_DELAY));
306+
while(!uart_ll_is_tx_idle(UART_LL_GET_HW(uart->num)));
310307

311308
if ( !txOnly ) {
312309
ESP_ERROR_CHECK(uart_flush_input(uart->num));

0 commit comments

Comments
 (0)