fix(spi_flash): add suspend related code back

This commit is contained in:
Xiao Xufeng
2026-01-29 14:31:27 +08:00
parent 6539624176
commit 34035b0e7c
@@ -37,6 +37,10 @@
__attribute__((unused)) static const char TAG[] = "spi_flash"; __attribute__((unused)) static const char TAG[] = "spi_flash";
#if !CONFIG_SPI_FLASH_AUTO_SUSPEND && !CONFIG_SPI_FLASH_PLACE_FUNCTIONS_IN_IRAM
#error "CONFIG_SPI_FLASH_PLACE_FUNCTIONS_IN_IRAM cannot be disabled when CONFIG_SPI_FLASH_AUTO_SUSPEND is disabled."
#endif
#if CONFIG_SPI_FLASH_ROM_IMPL && (CONFIG_ESPTOOLPY_FLASHSIZE_32MB || CONFIG_ESPTOOLPY_FLASHSIZE_64MB || CONFIG_ESPTOOLPY_FLASHSIZE_128MB) #if CONFIG_SPI_FLASH_ROM_IMPL && (CONFIG_ESPTOOLPY_FLASHSIZE_32MB || CONFIG_ESPTOOLPY_FLASHSIZE_64MB || CONFIG_ESPTOOLPY_FLASHSIZE_128MB)
#error "Flash chip size equal or over 32MB memory cannot use driver in ROM" #error "Flash chip size equal or over 32MB memory cannot use driver in ROM"
#endif #endif
@@ -557,6 +561,10 @@ esp_err_t esp_flash_init_default_chip(void)
cfg.auto_waiti_pes = true; cfg.auto_waiti_pes = true;
#endif #endif
#if CONFIG_SPI_FLASH_SOFTWARE_RESUME
cfg.software_resume = true;
#endif
//the host is already initialized, only do init for the data and load it to the host //the host is already initialized, only do init for the data and load it to the host
esp_err_t err = memspi_host_init_pointers(&esp_flash_default_host, &cfg); esp_err_t err = memspi_host_init_pointers(&esp_flash_default_host, &cfg);
if (err != ESP_OK) { if (err != ESP_OK) {