Skip to content

Commit 16cf0d5

Browse files
Fix some idf version issues (#370) (#376)
(cherry picked from commit eecadcf) Co-authored-by: Narukara <narukara@foxmail.com>
1 parent b84f9dd commit 16cf0d5

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
@@ -119,22 +119,19 @@ void app_main(void)
119119
// Configure dynamic frequency scaling:
120120
// maximum and minimum frequencies are set in sdkconfig,
121121
// automatic light sleep is enabled if tickless idle support is enabled.
122-
#ifdef CONFIG_IDF_TARGET_ESP32S2
123-
esp_pm_config_esp32s2_t pm_config = {};
124-
#elif CONFIG_IDF_TARGET_ESP32C3
125-
esp_pm_config_esp32c3_t pm_config = {};
126-
#else
127-
esp_pm_config_esp32_t pm_config = {};
128-
#endif
122+
esp_pm_config_t pm_config = {};
129123
pm_config.max_freq_mhz = 240;
124+
130125
#ifdef CONFIG_IDF_TARGET_ESP32S2
131126
pm_config.min_freq_mhz = 10;
132127
#else
133128
pm_config.min_freq_mhz = 20;
134-
#endif
129+
#endif /* CONFIG_IDF_TARGET_ESP32S2 */
130+
135131
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
136132
pm_config.light_sleep_enable = true;
137-
#endif
133+
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
134+
138135
ESP_ERROR_CHECK(esp_pm_configure(&pm_config));
139136
#endif /* CONFIG_PM_ENABLE */
140137

0 commit comments

Comments
 (0)