mirror of
https://github.com/espressif/esp-matter.git
synced 2026-04-27 19:13:13 +00:00
Merge branch 'fix/nvs_api' into 'main'
Add the nvs commit and close calls in factory_reset and erase_persistent_data. See merge request app-frameworks/esp-matter!494
This commit is contained in:
@@ -430,6 +430,8 @@ static esp_err_t erase_persistent_data(endpoint_t *endpoint)
|
||||
if (err != ESP_OK) {
|
||||
ESP_LOGE(TAG, "Error erasing partition: %s, %d", nvs_namespace, err);
|
||||
}
|
||||
nvs_commit(handle);
|
||||
nvs_close(handle);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -1041,6 +1043,9 @@ esp_err_t factory_reset()
|
||||
nvs_erase_all(node_handle);
|
||||
}
|
||||
|
||||
nvs_close(node_handle);
|
||||
nvs_commit(node_handle);
|
||||
|
||||
endpoint_t *endpoint = endpoint::get_first(node);
|
||||
while (endpoint) {
|
||||
err = endpoint::erase_persistent_data(endpoint);
|
||||
|
||||
Reference in New Issue
Block a user