Make firmware updating more foolproof (#469)

* Make firmware updating more foolproof and fix bugs
* No need to manually handle overflow
* Make startTime TickType_t
* Don't process TouchEvents::None
* Fix sleep getting re-enabled issue more directly
This commit is contained in:
Riku Isokoski
2021-07-22 22:57:45 +03:00
committed by GitHub
parent 57b3397078
commit 0a0f28fff4
5 changed files with 52 additions and 17 deletions

View File

@@ -177,9 +177,13 @@ void DisplayApp::Refresh() {
}
break;
case Messages::TouchEvent: {
if (state != States::Running)
if (state != States::Running) {
break;
}
auto gesture = OnTouchEvent();
if (gesture == TouchEvents::None) {
break;
}
if (!currentScreen->OnTouchEvent(gesture)) {
if (currentApp == Apps::Clock) {
switch (gesture) {
@@ -286,6 +290,7 @@ void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction)
break;
case Apps::FirmwareUpdate:
currentScreen = std::make_unique<Screens::FirmwareUpdate>(this, bleController);
ReturnApp(Apps::Clock, FullRefreshDirections::Down, TouchEvents::None);
break;
case Apps::Notifications: