Merge branch 'feature/nvs_version_check' into 'master'

nvs_flash: Version compatibility check for nvs storage

See merge request idf/esp-idf!2855
This commit is contained in:
Angus Gratton
2018-08-07 13:31:49 +08:00
45 changed files with 88 additions and 47 deletions
@@ -469,7 +469,7 @@ void app_main()
// Initialize NVS.
ret = nvs_flash_init();
if (ret == ESP_ERR_NVS_NO_FREE_PAGES) {
if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) {
ESP_ERROR_CHECK(nvs_flash_erase());
ret = nvs_flash_init();
}