Delete firmware file if exists after factory reset

This commit is contained in:
Gunnar Skjold 2022-03-18 19:35:58 +01:00
parent 48bd352619
commit 0590ec375d

View File

@ -258,7 +258,9 @@ void setup() {
if(hasFs) {
bool flashed = false;
if(LittleFS.exists(FILE_FIRMWARE)) {
if (gpioConfig.apPin == 0xFF || digitalRead(gpioConfig.apPin) == HIGH) {
if (!config.hasConfig()) {
debugI("Device has no config, yet a firmware file exists, deleting file.");
} else if (gpioConfig.apPin == 0xFF || digitalRead(gpioConfig.apPin) == HIGH) {
if(Debug.isActive(RemoteDebug::INFO)) debugI("Found firmware");
#if defined(ESP8266)
WiFi.setSleepMode(WIFI_LIGHT_SLEEP);