components/nvs: avoid reading just-erased page
This commit is contained in:
parent
31f74b8008
commit
f06ebeba86
2 changed files with 7 additions and 2 deletions
|
@ -17,7 +17,7 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <esp_err.h>
|
#include "esp_err.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
|
@ -671,7 +671,12 @@ esp_err_t Page::erase()
|
||||||
mState = PageState::INVALID;
|
mState = PageState::INVALID;
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
return load(sector);
|
mUsedEntryCount = 0;
|
||||||
|
mErasedEntryCount = 0;
|
||||||
|
mFirstUsedEntry = INVALID_ENTRY;
|
||||||
|
mNextFreeEntry = INVALID_ENTRY;
|
||||||
|
mState = PageState::UNINITIALIZED;
|
||||||
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
esp_err_t Page::markFreeing()
|
esp_err_t Page::markFreeing()
|
||||||
|
|
Loading…
Reference in a new issue