sleep: don't power down VDD_SDIO in light sleep if SPIRAM is enabled

This commit is contained in:
Ivan Grokhotkov 2017-10-18 20:04:40 +08:00
parent d55ddfe56d
commit ae7404972c

View file

@ -231,16 +231,19 @@ esp_err_t esp_light_sleep_start()
// Decide which power domains can be powered down
uint32_t pd_flags = get_power_down_flags();
// Decide if flash needs to be powered down;
// If it needs to be powered down, adjust sleep time
// Decide if VDD_SDIO needs to be powered down;
// If it needs to be powered down, adjust sleep time.
const uint32_t flash_enable_time_us = VDD_SDIO_POWERUP_TO_FLASH_READ_US
+ CONFIG_ESP32_DEEP_SLEEP_WAKEUP_DELAY;
// Don't power down VDD_SDIO if pSRAM is used.
#ifndef CONFIG_SPIRAM_SUPPORT
if (s_config.sleep_duration > FLASH_PD_MIN_SLEEP_TIME_US &&
s_config.sleep_duration > flash_enable_time_us) {
pd_flags |= RTC_SLEEP_PD_VDDSDIO;
s_config.sleep_duration -= flash_enable_time_us;
}
#endif //CONFIG_SPIRAM_SUPPORT
// Safety net: enable WDT in case exit from light sleep fails
rtc_wdt_enable(1000);