Skip to content

Commit

Permalink
Fix ESP32 UART configuration for ESP-IDF >= 5.0
Browse files Browse the repository at this point in the history
Include 'source_clk' field in the 'uart_config_t' struct for ESP-IDF >= 5.0
to address compatibility error.

Signed-off-by: tovam <tovam@users.noreply.github.com>
  • Loading branch information
tovam committed Nov 19, 2023
1 parent 2eeb24f commit 77fc029
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/platforms/esp32/components/avm_builtins/uart_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 77fc029

Please sign in to comment.