Switch to OTA app if an unexpected error occurs

This commit is contained in:
Correl Roush 2023-01-22 18:19:20 -05:00
parent 77dca1afab
commit 6b9ca8c389

View file

@ -186,10 +186,14 @@ void loop()
} else if (M5.BtnC.wasClicked()) { } else if (M5.BtnC.wasClicked()) {
next = App::Text; next = App::Text;
} }
if (next != current_app) { try {
switch_app(next); if (next != current_app) {
} else { switch_app(next);
app->loop(); } else {
app->loop();
}
} catch (...) {
switch_app(App::OTA);
} }
yield(); yield();
} }