feat(nvs): Allow read-only NVS partitions smaller than 0x3000
E.g. for factory settings data Closes https://github.com/espressif/esp-idf/issues/15317
This commit is contained in:
@@ -110,7 +110,7 @@ public:
|
||||
size_t columns = size / column_size;
|
||||
size_t column;
|
||||
|
||||
for(column = 0; column < columns; column = column + 1)
|
||||
for(column = 0; column < columns; ++column)
|
||||
{
|
||||
// read column
|
||||
if((err = esp_partition_read_raw(&esp_partition, dst_offset + (column * column_size), buff, column_size)) != ESP_OK) return err;
|
||||
|
||||
@@ -124,8 +124,8 @@ esp_err_t PageManager::load(Partition *partition, uint32_t baseSector, uint32_t
|
||||
}
|
||||
}
|
||||
|
||||
// partition should have at least one free page
|
||||
if (mFreePageList.empty()) {
|
||||
// partition should have at least one free page if it is not read-only
|
||||
if (!partition->get_readonly() && mFreePageList.empty()) {
|
||||
return ESP_ERR_NVS_NO_FREE_PAGES;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user