Skip to content

Commit 4ef5f51

Browse files
committed
cpu/esp32/periph/pm: migration to ESP-IDF v5.4
1 parent 1788e2c commit 4ef5f51

File tree

1 file changed

+4
-0
lines changed
  • cpu/esp32/periph

1 file changed

+4
-0
lines changed

cpu/esp32/periph/pm.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,10 @@ static inline void pm_set_lowest_normal(void)
8585
void IRAM_ATTR pm_off(void)
8686
{
8787
/* disable remaining power domains */
88+
#if ESP_PD_DOMAIN_RTC_SLOW_MEM && ESP_PD_DOMAIN_RTC_FAST_MEM
8889
esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_SLOW_MEM, ESP_PD_OPTION_OFF);
8990
esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_FAST_MEM, ESP_PD_OPTION_OFF);
91+
#endif
9092

9193
/* enter hibernate mode without any enabled wake-up sources */
9294
esp_sleep_disable_wakeup_source(ESP_SLEEP_WAKEUP_ALL);
@@ -137,6 +139,7 @@ void pm_set(unsigned mode)
137139
/* flush stdout */
138140
fflush(stdout);
139141

142+
#if SOC_PM_SUPPORT_RTC_SLOW_MEM_PD
140143
/* Labels for RTC slow memory that are defined in the linker script */
141144
extern int _rtc_bss_rtc_start;
142145
extern int _rtc_bss_rtc_end;
@@ -151,6 +154,7 @@ void pm_set(unsigned mode)
151154
if (&_rtc_bss_rtc_end > &_rtc_bss_rtc_start) {
152155
esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_SLOW_MEM, ESP_PD_OPTION_ON);
153156
}
157+
#endif
154158

155159
/* first disable all wake-up sources */
156160
esp_sleep_disable_wakeup_source(ESP_SLEEP_WAKEUP_ALL);

0 commit comments

Comments
 (0)