summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIhor Nehrutsa <Ihor.Nehrutsa@gmail.com>2023-11-13 13:58:22 +0200
committerDamien George <damien@micropython.org>2023-12-11 12:59:14 +1100
commita427117d0390f22e8cbb6d295a5800363a6733d5 (patch)
tree006d30916ebbc258c48fba67da353fc6cb0ad51c
parente423b3c0ba09d7f8b1b9081e2edb520455aaad33 (diff)
esp32/modmachine: Fix deprecated esp_pm_config_XXX_t.
Co-Authored-By: Trent Piepho <35062987+xyzzy42@users.noreply.github.com> Signed-off-by: IhorNehrutsa <Ihor.Nehrutsa@gmail.com>
-rwxr-xr-x[-rw-r--r--]ports/esp32/modmachine.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ports/esp32/modmachine.c b/ports/esp32/modmachine.c
index a3437f10c..145ae9341 100644..100755
--- a/ports/esp32/modmachine.c
+++ b/ports/esp32/modmachine.c
@@ -111,6 +111,9 @@ STATIC void mp_machine_set_freq(size_t n_args, const mp_obj_t *args) {
mp_raise_ValueError(MP_ERROR_TEXT("frequency must be 20MHz, 40MHz, 80Mhz, 160MHz or 240MHz"));
#endif
}
+ #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 1, 0)
+ esp_pm_config_t pm;
+ #else
#if CONFIG_IDF_TARGET_ESP32
esp_pm_config_esp32_t pm;
#elif CONFIG_IDF_TARGET_ESP32C3
@@ -120,6 +123,7 @@ STATIC void mp_machine_set_freq(size_t n_args, const mp_obj_t *args) {
#elif CONFIG_IDF_TARGET_ESP32S3
esp_pm_config_esp32s3_t pm;
#endif
+ #endif
pm.max_freq_mhz = freq;
pm.min_freq_mhz = freq;
pm.light_sleep_enable = false;