ESP factory reset clear NVS too

Этот коммит содержится в:
liquidraver
2026-01-02 08:37:22 +01:00
родитель f9720f0b0c
Коммит faf177de46
2 изменённых файлов: 8 добавлений и 1 удалений
+4
Просмотреть файл
@@ -1613,6 +1613,10 @@ void MyMesh::handleCmdFrame(size_t len) {
writeErrFrame(ERR_CODE_ILLEGAL_ARG); // invalid stats sub-type
}
} else if (cmd_frame[0] == CMD_FACTORY_RESET && memcmp(&cmd_frame[1], "reset", 5) == 0) {
if (_serial) {
MESH_DEBUG_PRINTLN("Factory reset: disabling serial interface to prevent reconnects (BLE/WiFi)");
_serial->disable(); // Phone app disconnects before we can send OK frame so it's safe here
}
bool success = _store->formatFileSystem();
if (success) {
writeOKFrame();