Skip to content

Commit b5eee69

Browse files
Fix some idf version issues (#370) (#375)
(cherry picked from commit eecadcf) Co-authored-by: Narukara <narukara@foxmail.com>
1 parent 6e33f19 commit b5eee69

2 files changed

Lines changed: 7 additions & 14 deletions

File tree

‎CMakeLists.txt‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@ else()
2121
set(submake "make")
2222
endif()
2323

24-
if (${IDF_VERSION_MAJOR} EQUAL 5)
25-
set(CMAKE_C_STANDARD 17)
26-
else()
27-
set(CMAKE_C_STANDARD 11)
28-
endif()
24+
set(CMAKE_C_STANDARD 17)
2925

3026
set(APP_COLCON_META "${PROJECT_DIR}/app-colcon.meta")
3127
if(NOT EXISTS "${APP_COLCON_META}")

‎examples/low_consumption/main/main.c‎

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,22 +118,19 @@ void app_main(void)
118118
// Configure dynamic frequency scaling:
119119
// maximum and minimum frequencies are set in sdkconfig,
120120
// automatic light sleep is enabled if tickless idle support is enabled.
121-
#ifdef CONFIG_IDF_TARGET_ESP32S2
122-
esp_pm_config_esp32s2_t pm_config = {};
123-
#elif CONFIG_IDF_TARGET_ESP32C3
124-
esp_pm_config_esp32c3_t pm_config = {};
125-
#else
126-
esp_pm_config_esp32_t pm_config = {};
127-
#endif
121+
esp_pm_config_t pm_config = {};
128122
pm_config.max_freq_mhz = 240;
123+
129124
#ifdef CONFIG_IDF_TARGET_ESP32S2
130125
pm_config.min_freq_mhz = 10;
131126
#else
132127
pm_config.min_freq_mhz = 20;
133-
#endif
128+
#endif /* CONFIG_IDF_TARGET_ESP32S2 */
129+
134130
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
135131
pm_config.light_sleep_enable = true;
136-
#endif
132+
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
133+
137134
ESP_ERROR_CHECK(esp_pm_configure(&pm_config));
138135
#endif /* CONFIG_PM_ENABLE */
139136

0 commit comments

Comments
 (0)