Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
esp32/modmachine.c: Fix deprecated esp_pm_config_XXX_t.
Browse files Browse the repository at this point in the history
Co-Authored-By: Trent Piepho <35062987+xyzzy42@users.noreply.github.com>

Signed-off-by: IhorNehrutsa <Ihor.Nehrutsa@gmail.com>
IhorNehrutsa committed Nov 13, 2023
1 parent 48aa74e commit 6652fc8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ports/esp32/modmachine.c
Original file line number Diff line number Diff line change
@@ -78,6 +78,9 @@ STATIC mp_obj_t machine_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
@@ -87,6 +90,8 @@ STATIC mp_obj_t machine_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;

0 comments on commit 6652fc8

Please sign in to comment.