Factory reset on very long press.

This commit is contained in:
Blaž Kristan 2022-01-24 14:20:21 +01:00
parent 24a5f7a38e
commit 34865f797f

View File

@ -254,7 +254,11 @@ void handleButton()
bool doublePress = buttonWaitTime[b]; //did we have a short press before?
buttonWaitTime[b] = 0;
if (b == 0 && dur > WLED_LONG_AP) { //long press on button 0 (when released)
if (b == 0 && dur > 2*WLED_LONG_AP) { //very long press on button 0 (when released)
WLED_FS.format();
clearEEPROM();
doReboot = true;
} else if (b == 0 && dur > WLED_LONG_AP) { //long press on button 0 (when released)
WLED::instance().initAP(true);
} else if (!buttonLongPressed[b]) { //short press
//NOTE: this interferes with double click handling in usermods so it is commented out