Skip to content

Commit 3e549d6

Browse files
authored
fix(uart): considers that it may set the LP UART as well
1 parent 291358d commit 3e549d6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

cores/esp32/esp32-hal-uart.c

+8-1
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,14 @@ uart_t *uartBegin(
736736
uart->_tx_buffer_size = tx_buffer_size;
737737
uart->has_peek = false;
738738
uart->peek_byte = 0;
739-
uart->_uart_clock_source = uart_config.source_clk;
739+
#if SOC_UART_LP_NUM >= 1
740+
if (uart_nr >= SOC_UART_HP_NUM) {
741+
uart->_uart_clock_source = uart_config.lp_source_clk;
742+
} else
743+
#endif
744+
{
745+
uart->_uart_clock_source = uart_config.source_clk;
746+
}
740747
}
741748
UART_MUTEX_UNLOCK();
742749

0 commit comments

Comments
 (0)