Browse Source

Added reset confirmation

master
Robin Thoni 4 years ago
parent
commit
fc4a9439b7
Signed by: Robin THONI <robin@rthoni.com> GPG Key ID: 4E09DEF46B99E61E
1 changed files with 13 additions and 0 deletions
  1. 13
    0
      AppCore.cpp

+ 13
- 0
AppCore.cpp View File

@@ -95,6 +95,7 @@ void AppCore::setup()
95 95
     bool allButtonsPressed = true;
96 96
     for (auto& g_button : m_buttons)
97 97
     {
98
+        g_button->read();
98 99
         allButtonsPressed = allButtonsPressed && g_button->isPressed();
99 100
     }
100 101
     if (!allButtonsPressed)
@@ -106,6 +107,18 @@ void AppCore::setup()
106 107
     {
107 108
         LOG(5, "%s: Resetting settings", __FUNCTION__);
108 109
         m_storage.save(*m_appCoreState);
110
+        m_lcd.clear();
111
+        m_lcd.setCursor(6, 0);
112
+        m_lcd.print("Reset");
113
+        bool allButtonsPressed = true;
114
+        while (allButtonsPressed)
115
+        {
116
+            for (auto& g_button : m_buttons)
117
+            {
118
+                g_button->read();
119
+                allButtonsPressed = allButtonsPressed && g_button->isPressed();
120
+            }
121
+        }
109 122
     }
110 123
 
111 124
     LOG_FN_END(1);

Loading…
Cancel
Save