From c6e2248090bea5d3c4e69dd6bdd41c623a2796d0 Mon Sep 17 00:00:00 2001 From: Dejvino Date: Tue, 17 Feb 2026 00:52:36 +0100 Subject: [PATCH] Factory Reset --- RP2040_Tracker.ino | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/RP2040_Tracker.ino b/RP2040_Tracker.ino index 25fce37..9d5d022 100644 --- a/RP2040_Tracker.ino +++ b/RP2040_Tracker.ino @@ -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;