mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
spi_flash(new driver): Add a Kconfig option - Bypass a block erase and always do sector erase
Closes: IDF-1561
This commit is contained in:
parent
304f67e42a
commit
bc50bd2806
@ -351,13 +351,15 @@ esp_err_t IRAM_ATTR esp_flash_erase_region(esp_flash_t *chip, uint32_t start, ui
|
||||
return err;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_SPI_FLASH_BYPASS_BLOCK_ERASE
|
||||
// If possible erase an entire multi-sector block
|
||||
if (block_erase_size > 0 && len >= block_erase_size && (start % block_erase_size) == 0) {
|
||||
err = chip->chip_drv->erase_block(chip, start);
|
||||
start += block_erase_size;
|
||||
len -= block_erase_size;
|
||||
}
|
||||
else {
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
// Otherwise erase individual sector only
|
||||
err = chip->chip_drv->erase_sector(chip, start);
|
||||
start += sector_size;
|
||||
|
Loading…
Reference in New Issue
Block a user