components/nvs: add erase function

This change exposes functions to erase single key and to erase all keys from namespace.
TW6769, TW6839
This commit is contained in:
Ivan Grokhotkov
2016-09-23 00:36:53 +08:00
parent e87d80d478
commit 2a68f60874
7 changed files with 125 additions and 30 deletions
-13
View File
@@ -278,19 +278,6 @@ esp_err_t Page::findItem(uint8_t nsIndex, ItemType datatype, const char* key)
return findItem(nsIndex, datatype, key, index, item);
}
esp_err_t Page::eraseEntry(size_t index)
{
auto state = mEntryTable.get(index);
assert(state == EntryState::WRITTEN || state == EntryState::EMPTY);
auto rc = alterEntryState(index, EntryState::ERASED);
if (rc != ESP_OK) {
return rc;
}
return ESP_OK;
}
esp_err_t Page::eraseEntryAndSpan(size_t index)
{
auto state = mEntryTable.get(index);