fix(uart): clock source (#10172)
Problem detected with ESP32 and ESP32-S2 when the baudrate goes to 460600 bps. REF_TICK (2MHz) seem not to work properly. Limiting the use of REF_TICK for up to 205 Kbps.
This commit is contained in:
parent
49a3c10ce0
commit
2a971751a7
1 changed files with 2 additions and 2 deletions
|
|
@ -508,8 +508,8 @@ uart_t *uartBegin(
|
|||
#if SOC_UART_SUPPORT_XTAL_CLK
|
||||
uart_config.source_clk = UART_SCLK_XTAL; // valid for C2, S3, C3, C6, H2 and P4
|
||||
#elif SOC_UART_SUPPORT_REF_TICK
|
||||
if (baudrate <= 1000000) {
|
||||
uart_config.source_clk = UART_SCLK_REF_TICK; // valid for ESP32, S2 - MAX supported baud rate is 1MHz
|
||||
if (baudrate <= 250000) {
|
||||
uart_config.source_clk = UART_SCLK_REF_TICK; // valid for ESP32, S2 - MAX supported baud rate is 250 Kbps
|
||||
} else {
|
||||
uart_config.source_clk = UART_SCLK_APB; // baudrate may change with the APB Frequency!
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue