Erase NVS flash on init failure

This commit is contained in:
Sandeep Mistry
2018-11-12 16:41:13 -05:00
parent 7481928992
commit 25b73d5196

View File

@@ -22,5 +22,9 @@
#include "Arduino.h"
void init() {
nvs_flash_init();
if (nvs_flash_init() != ESP_OK) {
nvs_flash_erase();
nvs_flash_init();
}
}