From 77fc0299d94b4b7c5633a3e1592564de950e6f6a Mon Sep 17 00:00:00 2001 From: tovam Date: Sun, 19 Nov 2023 05:47:30 +0100 Subject: [PATCH] Fix ESP32 UART configuration for ESP-IDF >= 5.0 Include 'source_clk' field in the 'uart_config_t' struct for ESP-IDF >= 5.0 to address compatibility error. Signed-off-by: tovam --- src/platforms/esp32/components/avm_builtins/uart_driver.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/platforms/esp32/components/avm_builtins/uart_driver.c b/src/platforms/esp32/components/avm_builtins/uart_driver.c index af397f4e22..474b8d6d6e 100644 --- a/src/platforms/esp32/components/avm_builtins/uart_driver.c +++ b/src/platforms/esp32/components/avm_builtins/uart_driver.c @@ -257,6 +257,9 @@ Context *uart_driver_create_port(GlobalContext *global, term opts) } uart_config_t uart_config = { +#if ESP_IDF_VERSION_MAJOR >= 5 + .source_clk = UART_SCLK_DEFAULT, +#endif .baud_rate = uart_speed, .data_bits = data_bits, .parity = parity,