Skip to content

Commit bad975d

Browse files
authored
fix(uart): removes assert() to avoid reset (#11508)
1 parent 95ae8cf commit bad975d

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
@@ -305,7 +305,10 @@ static bool _uartTrySetIomuxPin(uart_port_t uart_num, int io_num, uint32_t idx)
305305
}
306306

307307
// Assign the correct function to the GPIO.
308-
assert(upin->iomux_func != -1);
308+
if (upin->iomux_func == -1) {
309+
log_e("IO#%d has bad IOMUX internal information. Switching to GPIO Matrix UART function.", io_num);
310+
return false;
311+
}
309312
if (uart_num < SOC_UART_HP_NUM) {
310313
gpio_iomux_out(io_num, upin->iomux_func, false);
311314
// If the pin is input, we also have to redirect the signal, in order to bypass the GPIO matrix.

0 commit comments

Comments
 (0)