mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
nvs_flash: remove leftover ESP_ERROR_CHECKS
Similar to the asserts, these are replaced by error checks.
This commit is contained in:
parent
02661081be
commit
bee241b0e2
@ -47,7 +47,10 @@ esp_err_t PageManager::load(Partition *partition, uint32_t baseSector, uint32_t
|
||||
return activatePage();
|
||||
} else {
|
||||
uint32_t lastSeqNo;
|
||||
ESP_ERROR_CHECK( mPageList.back().getSeqNumber(lastSeqNo) );
|
||||
auto err = mPageList.back().getSeqNumber(lastSeqNo);
|
||||
if (err != ESP_OK) {
|
||||
return err;
|
||||
}
|
||||
mSeqNumber = lastSeqNo + 1;
|
||||
}
|
||||
|
||||
|
@ -305,7 +305,10 @@ esp_err_t Storage::writeItem(uint8_t nsIndex, ItemType datatype, const char* key
|
||||
|
||||
if (findPage->state() == Page::PageState::UNINITIALIZED ||
|
||||
findPage->state() == Page::PageState::INVALID) {
|
||||
ESP_ERROR_CHECK(findItem(nsIndex, datatype, key, findPage, item));
|
||||
err = findItem(nsIndex, datatype, key, findPage, item);
|
||||
if (err != ESP_OK) {
|
||||
return err;
|
||||
}
|
||||
}
|
||||
/* Get the version of the previous index with same <ns,key> */
|
||||
prevStart = item.blobIndex.chunkStart;
|
||||
@ -383,7 +386,10 @@ esp_err_t Storage::writeItem(uint8_t nsIndex, ItemType datatype, const char* key
|
||||
if (findPage) {
|
||||
if (findPage->state() == Page::PageState::UNINITIALIZED ||
|
||||
findPage->state() == Page::PageState::INVALID) {
|
||||
ESP_ERROR_CHECK(findItem(nsIndex, datatype, key, findPage, item));
|
||||
err = findItem(nsIndex, datatype, key, findPage, item);
|
||||
if (err != ESP_OK) {
|
||||
return err;
|
||||
}
|
||||
}
|
||||
err = findPage->eraseItem(nsIndex, datatype, key);
|
||||
if (err == ESP_ERR_FLASH_OP_FAIL) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user