Skip to content

Commit 9d86f0c

Browse files
committed
fix compile errors from github actions
1 parent 4fa5144 commit 9d86f0c

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

‎extras/idf_examples/Issue370/Issue370.cpp‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737

3838
#include <cstring>
3939
#include "driver/uart.h"
40+
#include "esp_idf_version.h"
4041
#include "esp_rom_sys.h"
4142
#include "esp_task_wdt.h"
4243
#include "freertos/FreeRTOS.h"
@@ -56,7 +57,11 @@ static void serialInit() {
5657
uart_config.parity = UART_PARITY_DISABLE;
5758
uart_config.stop_bits = UART_STOP_BITS_1;
5859
uart_config.flow_ctrl = UART_HW_FLOWCTRL_DISABLE;
60+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
5961
uart_config.source_clk = UART_SCLK_DEFAULT;
62+
#else
63+
uart_config.source_clk = UART_SCLK_APB;
64+
#endif
6065
uart_param_config(UART_NUM_0, &uart_config);
6166
uart_driver_install(UART_NUM_0, 256, 0, 0, NULL, 0);
6267
}

‎extras/idf_examples/Issue370_minimal/Issue370.cpp‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737

3838
#include <cstring>
3939
#include "driver/uart.h"
40+
#include "esp_idf_version.h"
4041
#include "esp_rom_sys.h"
4142
#include "esp_task_wdt.h"
4243
#include "freertos/FreeRTOS.h"
@@ -56,7 +57,11 @@ static void serialInit() {
5657
uart_config.parity = UART_PARITY_DISABLE;
5758
uart_config.stop_bits = UART_STOP_BITS_1;
5859
uart_config.flow_ctrl = UART_HW_FLOWCTRL_DISABLE;
60+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
5961
uart_config.source_clk = UART_SCLK_DEFAULT;
62+
#else
63+
uart_config.source_clk = UART_SCLK_APB;
64+
#endif
6065
uart_param_config(UART_NUM_0, &uart_config);
6166
uart_driver_install(UART_NUM_0, 256, 0, 0, NULL, 0);
6267
}

0 commit comments

Comments
 (0)