mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
ESP factory reset clear NVS too
This commit is contained in:
parent
f9720f0b0c
commit
faf177de46
2 changed files with 8 additions and 1 deletions
|
|
@ -65,6 +65,7 @@ void DataStore::begin() {
|
|||
|
||||
#if defined(ESP32)
|
||||
#include <SPIFFS.h>
|
||||
#include <nvs_flash.h>
|
||||
#elif defined(RP2040_PLATFORM)
|
||||
#include <LittleFS.h>
|
||||
#elif defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)
|
||||
|
|
@ -172,7 +173,9 @@ bool DataStore::formatFileSystem() {
|
|||
#elif defined(RP2040_PLATFORM)
|
||||
return LittleFS.format();
|
||||
#elif defined(ESP32)
|
||||
return ((fs::SPIFFSFS *)_fs)->format();
|
||||
bool fs_success = ((fs::SPIFFSFS *)_fs)->format();
|
||||
esp_err_t nvs_err = nvs_flash_erase(); // no need to reinit, will be done by reboot
|
||||
return fs_success && (nvs_err == ESP_OK);
|
||||
#else
|
||||
#error "need to implement format()"
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue