Skip to content

Commit a137e33

Browse files
authored
fix(uart): removes assert() to avoid reset espressif#11508
1 parent 4a19be1 commit a137e33

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cores/esp32/esp32-hal-uart.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,10 @@ static bool _uartTrySetIomuxPin(uart_port_t uart_num, int io_num, uint32_t idx)
213213
}
214214

215215
// Assign the correct function to the GPIO.
216-
assert(upin->iomux_func != -1);
216+
if (upin->iomux_func == -1) {
217+
log_e("IO#%d has bad IOMUX internal information. Switching to GPIO Matrix UART function.", io_num);
218+
return false;
219+
}
217220
if (uart_num < SOC_UART_HP_NUM) {
218221
gpio_iomux_out(io_num, upin->iomux_func, false);
219222
// If the pin is input, we also have to redirect the signal, in order to bypass the GPIO matrix.

0 commit comments

Comments
 (0)