mirror of
https://github.com/espressif/esp-matter.git
synced 2026-04-27 11:03:05 +00:00
Backport the nvs_api fix to release/v1.0.
This commit is contained in:
committed by
Hrishikesh Dhayagude
parent
dbaabc82e0
commit
d2ad891d00
@@ -417,6 +417,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;
|
||||
}
|
||||
|
||||
@@ -993,6 +995,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