mirror of
https://github.com/espressif/esp-idf.git
synced 2026-05-19 23:45:28 +02:00
nvs-flash: Support for blobs larger than half of SPI Flash sector size
This change removes the earlier limitation of 1984 bytes for storing data-blobs. Blobs larger than the sector size are split and stored on multiple sectors. For this purpose, two new datatypes (multi-page index and multi-page data) are added for entries stored in the sectors. The underlying read, write, erase and find operations are modified to support these large blobs. The change is transparent to users of the library and no special APIs need to be used to store these large blobs.
This commit is contained in:
@@ -43,7 +43,8 @@ public:
|
||||
{
|
||||
load(filename);
|
||||
// Atleast one page should be free, hence we create mData of size of 2 sectors.
|
||||
mData.resize(2 * SPI_FLASH_SEC_SIZE / 4, 0xffffffff);
|
||||
mData.resize(mData.size() + SPI_FLASH_SEC_SIZE / 4, 0xffffffff);
|
||||
mUpperSectorBound = mData.size() * 4 / SPI_FLASH_SEC_SIZE;
|
||||
spi_flash_emulator_set(this);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user