diff options
| author | Trent Piepho <tpiepho@gmail.com> | 2023-11-08 03:04:28 -0800 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2023-11-23 11:49:08 +1100 |
| commit | f72a7dde18600379471189b6727bb65bd2834519 (patch) | |
| tree | 93f443efb76bc3564910d67511139ed816b30b26 /py/compile.c | |
| parent | a85c3c45a6edc75da649492092e5ffdafae55d6a (diff) | |
esp32/uart: Preserve console UART clock, fix UART console with DFS.
In commit 7c929d44 the console UART was changed to use the UART HAL.
Starting the UART HAL will change the UART clock from whatever it was
already configured at to UART_SCLK_DEFAULT. There is no "initialize at
existing settings" option.
This clock doesn't work with DFS.
The ESP-IDF code already takes this into account, and when DFS is enabled
it will configure the console UART to use the correct platform-specific
clock that will work with DFS.
The UART HAL init undoes this and sets it back to default.
This change will query the clock before the HAL init, then use the HAL
function to restore it back. Thus keeping the clock at the "correct"
value, which depends on platform, DFS status, and so on.
The clock frequency will be found using the UART driver function ESP-IDF
code uses for this. The existing code hard-coded a path that worked if the
clock was the APB clock and would fail otherwise.
The UART_NUM_0 define is removed because driver/uart.h already provides
this same macro.
Signed-off-by: Trent Piepho <tpiepho@gmail.com>
Diffstat (limited to 'py/compile.c')
0 files changed, 0 insertions, 0 deletions
