Factory Reset
This commit is contained in:
parent
225d04a53c
commit
c6e2248090
@ -37,7 +37,7 @@ const int mainMenuCount = sizeof(mainMenu) / sizeof(char*);
|
||||
const char* randomizeMenu[] = { "Back", "Melody", "Flavour", "Scale", "Tempo", "Mutation", "Song Mode", "Theme 1", "Theme 2", "Theme 3", "Theme 4", "Theme 5", "Theme 6", "Theme 7" };
|
||||
const int THEME_1_INDEX = 7;
|
||||
const int randomizeMenuCount = sizeof(randomizeMenu) / sizeof(char*);
|
||||
const char* setupMenu[] = { "Back", "Channel", "Save", "Load" };
|
||||
const char* setupMenu[] = { "Back", "Channel", "Factory Reset" };
|
||||
const int setupMenuCount = sizeof(setupMenu) / sizeof(char*);
|
||||
|
||||
int menuSelection = 0;
|
||||
@ -149,6 +149,15 @@ bool loadSequence() {
|
||||
return true;
|
||||
}
|
||||
|
||||
void factoryReset() {
|
||||
ui.showMessage("RESETTING...");
|
||||
uint32_t magic = 0;
|
||||
EEPROM.put(0, magic);
|
||||
EEPROM.commit();
|
||||
delay(500);
|
||||
rp2040.reboot();
|
||||
}
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
|
||||
@ -356,14 +365,7 @@ void handleInput() {
|
||||
case UI_MENU_SETUP:
|
||||
if (menuSelection == 0) { currentState = UI_MENU_MAIN; menuSelection = 2; }
|
||||
if (menuSelection == 1) currentState = UI_SETUP_CHANNEL_EDIT;
|
||||
if (menuSelection == 2) {
|
||||
saveSequence();
|
||||
currentState = UI_MENU_MAIN;
|
||||
}
|
||||
if (menuSelection == 3) {
|
||||
if (loadSequence()) ui.showMessage("LOADED!");
|
||||
currentState = UI_MENU_MAIN;
|
||||
}
|
||||
if (menuSelection == 2) factoryReset();
|
||||
break;
|
||||
case UI_SETUP_CHANNEL_EDIT:
|
||||
currentState = UI_MENU_SETUP;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user