mirror of
https://github.com/correl/m5paper.git
synced 2024-11-27 19:09:50 +00:00
Switch to OTA app if an unexpected error occurs
This commit is contained in:
parent
77dca1afab
commit
6b9ca8c389
1 changed files with 8 additions and 4 deletions
12
src/main.cpp
12
src/main.cpp
|
@ -186,10 +186,14 @@ void loop()
|
|||
} else if (M5.BtnC.wasClicked()) {
|
||||
next = App::Text;
|
||||
}
|
||||
if (next != current_app) {
|
||||
switch_app(next);
|
||||
} else {
|
||||
app->loop();
|
||||
try {
|
||||
if (next != current_app) {
|
||||
switch_app(next);
|
||||
} else {
|
||||
app->loop();
|
||||
}
|
||||
} catch (...) {
|
||||
switch_app(App::OTA);
|
||||
}
|
||||
yield();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue