Factory reset at startup

pull/16/head
Łukasz Nidecki 2021-02-22 21:50:04 +01:00
parent 254076834e
commit 4e8899330e
1 changed files with 7 additions and 4 deletions

View File

@ -489,16 +489,19 @@ void setup(){
}
#ifdef ENABLE_PREFERENCES
if (clear_preferences == 2){
writedisplaytext("LoRa-APRS","","","Factory reset!!","","",0);
writedisplaytext("LoRa-APRS","","","Factory reset","","",0);
delay(1000);
if(digitalRead(BUTTON)==LOW){
clear_preferences = 3;
preferences.clear();
writedisplaytext("LoRa-APRS","","Factory reset","OK","","",0);
preferences.end();
writedisplaytext("LoRa-APRS","","Factory reset","Done!","","",0);
delay(2000);
ESP.restart();
} else {
writedisplaytext("LoRa-APRS","","Factory reset","Cancel","","",0);
delay(2000);
}
ESP.restart();
}
#endif
writedisplaytext("LoRa-APRS","","Init:","Display OK!","","",1000);