light sleep: fix Flash leakage when its CS pin has no hardware pullup

This commit is contained in:
Li Shuai 2021-09-16 16:35:03 +08:00
parent acdf49a5ac
commit 3f17cc2ab8
2 changed files with 12 additions and 0 deletions

View File

@ -109,6 +109,14 @@ menu "ESP System Settings"
pull-up, you do not need to select this option, otherwise, you
should enable this option.
config ESP_SYSTEM_FLASH_LEAKAGE_WORKAROUND
bool "Flash leakage current workaround in light sleep"
help
When the CS pin of Flash is not pulled up, the sleep current will
increase during light sleep. If the CS pin of Flash has an external
pull-up, you do not need to select this option, otherwise, you
should enable this option.
menu "Memory protection"
config ESP_SYSTEM_MEMPROT_FEATURE

View File

@ -29,6 +29,7 @@
#include "soc/soc_caps.h"
#include "driver/rtc_io.h"
#include "hal/rtc_io_hal.h"
#include "bootloader_common.h"
#include "driver/uart.h"
@ -424,6 +425,9 @@ void esp_sleep_config_gpio_isolate(void)
#if CONFIG_ESP_SYSTEM_PSRAM_LEAKAGE_WORKAROUND && CONFIG_SPIRAM
gpio_sleep_set_pull_mode(esp_spiram_get_cs_io(), GPIO_PULLUP_ONLY);
#endif
#if CONFIG_ESP_SYSTEM_FLASH_LEAKAGE_WORKAROUND
gpio_sleep_set_pull_mode(bootloader_flash_get_cs_io(), GPIO_PULLUP_ONLY);
#endif
}
void esp_sleep_enable_gpio_switch(bool enable)