Skip to content

Commit 85d83f3

Browse files
authored
fix(uart): uses IDF 5.x API to set loopback
Uses void uart_internal_loopback(uint8_t uartNum, bool loop_back_en) IDF 5.x API.
1 parent f083e2d commit 85d83f3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cores/esp32/esp32-hal-uart.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -1114,11 +1114,11 @@ unsigned long uartDetectBaudrate(uart_t *uart) {
11141114
This function internally binds defined UARTs TX signal with defined RX pin of any UART (same or different).
11151115
This creates a loop that lets us receive anything we send on the UART without external wires.
11161116
*/
1117-
void uart_internal_loopback(uint8_t uartNum, int8_t rxPin) {
1118-
if (uartNum > SOC_UART_NUM - 1 || !GPIO_IS_VALID_GPIO(rxPin)) {
1117+
void uart_internal_loopback(uint8_t uartNum, bool loop_back_en) {
1118+
if (uartNum > SOC_UART_NUM - 1) {
11191119
return;
11201120
}
1121-
esp_rom_gpio_connect_out_signal(rxPin, UART_TX_SIGNAL(uartNum), false, false);
1121+
uart_set_loop_back(uartNum, loop_back_en);
11221122
}
11231123

11241124
/*

0 commit comments

Comments
 (0)