Add a failsafe to clear settings on bootup with next button
This commit is contained in:
parent
2087101501
commit
770b27bf47
|
@ -2,13 +2,13 @@
|
||||||
// github.com/n0xa | IG: @4x0nn
|
// github.com/n0xa | IG: @4x0nn
|
||||||
|
|
||||||
// -=-=-=-=-=-=- Uncomment the platform you're building for -=-=-=-=-=-=-
|
// -=-=-=-=-=-=- Uncomment the platform you're building for -=-=-=-=-=-=-
|
||||||
#define STICK_C_PLUS
|
//#define STICK_C_PLUS
|
||||||
//#define STICK_C_PLUS2
|
//#define STICK_C_PLUS2
|
||||||
//#define STICK_C
|
//#define STICK_C
|
||||||
//#define CARDPUTER
|
#define CARDPUTER
|
||||||
// -=-=- Uncommenting more than one at a time will result in errors -=-=-
|
// -=-=- Uncommenting more than one at a time will result in errors -=-=-
|
||||||
|
|
||||||
String buildver="2.1.2";
|
String buildver="2.1.3";
|
||||||
#define BGCOLOR BLACK
|
#define BGCOLOR BLACK
|
||||||
#define FGCOLOR GREEN
|
#define FGCOLOR GREEN
|
||||||
|
|
||||||
|
@ -438,6 +438,17 @@ void smenu_setup() {
|
||||||
delay(500); // Prevent switching after menu loads up
|
delay(500); // Prevent switching after menu loads up
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void clearSettings(){
|
||||||
|
#if defined(USE_EEPROM)
|
||||||
|
EEPROM.write(0, 255); // Rotation
|
||||||
|
EEPROM.write(1, 255); // dim time
|
||||||
|
EEPROM.write(2, 255); // brightness
|
||||||
|
EEPROM.write(3, 255); // TV-B-Gone Region
|
||||||
|
EEPROM.commit();
|
||||||
|
#endif
|
||||||
|
ESP.restart();
|
||||||
|
}
|
||||||
|
|
||||||
void smenu_loop() {
|
void smenu_loop() {
|
||||||
if (check_next_press()) {
|
if (check_next_press()) {
|
||||||
cursor++;
|
cursor++;
|
||||||
|
@ -449,14 +460,7 @@ void smenu_loop() {
|
||||||
rstOverride = false;
|
rstOverride = false;
|
||||||
isSwitching = true;
|
isSwitching = true;
|
||||||
if(smenu[cursor].command == 99){
|
if(smenu[cursor].command == 99){
|
||||||
#if defined(USE_EEPROM)
|
clearSettings();
|
||||||
EEPROM.write(0, 255); // Rotation
|
|
||||||
EEPROM.write(1, 255); // dim time
|
|
||||||
EEPROM.write(2, 255); // brightness
|
|
||||||
EEPROM.write(2, 255); // TV-B-Gone Region
|
|
||||||
EEPROM.commit();
|
|
||||||
#endif
|
|
||||||
ESP.restart();
|
|
||||||
}
|
}
|
||||||
current_proc = smenu[cursor].command;
|
current_proc = smenu[cursor].command;
|
||||||
}
|
}
|
||||||
|
@ -1474,6 +1478,9 @@ void wscan_loop(){
|
||||||
|
|
||||||
void bootScreen(){
|
void bootScreen(){
|
||||||
// Boot Screen
|
// Boot Screen
|
||||||
|
if(check_next_press()){
|
||||||
|
clearSettings();
|
||||||
|
}
|
||||||
DISP.fillScreen(BGCOLOR);
|
DISP.fillScreen(BGCOLOR);
|
||||||
DISP.setTextSize(BIG_TEXT);
|
DISP.setTextSize(BIG_TEXT);
|
||||||
DISP.setCursor(40, 0);
|
DISP.setCursor(40, 0);
|
||||||
|
|
Loading…
Reference in New Issue