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 7222927
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed classes of exceptions in estdlib.
- Fixed STM32 code that was hard coded to the default target device, now configured based on the `cmake -DDEVICE=` parameter
- Fixed hard fault on STM32 durung malloc on boards with more than one bank of sram
- Fixed invalid src_clk error on ESP-IDF >= 5.0

### Changed

Expand Down
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 7222927

Please sign in to comment.