diff options
| author | Victor Kareh <vkareh@redhat.com> | 2024-01-08 10:02:45 -0500 |
|---|---|---|
| committer | JF <JF002@users.noreply.github.com> | 2025-12-13 21:31:50 +0100 |
| commit | 54f20ff4cb439f9997adb0e295caeb3130bfaecc (patch) | |
| tree | 21ab627797bfc9d98a6e143d4e4d1195d6d52460 /src/displayapp/DisplayApp.cpp | |
| parent | 7128fc045db083c7014166872b50b536942c06e0 (diff) | |
timer: Add ringing and counter
The timer app issues a short buzz once and then disappears. There is no
trace left that the timer finished or how long ago. This change makes
the motor start ringing and presents a timer counter.
The timer stops buzzing after 10 seconds, and finally resets after
1 minute.
Diffstat (limited to 'src/displayapp/DisplayApp.cpp')
| -rw-r--r-- | src/displayapp/DisplayApp.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index 45a41032..85e0ad56 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -368,19 +368,21 @@ void DisplayApp::Refresh() { case Messages::NewNotification: LoadNewScreen(Apps::NotificationsPreview, DisplayApp::FullRefreshDirections::Down); break; - case Messages::TimerDone: + case Messages::TimerDone: { if (state != States::Running) { PushMessageToSystemTask(System::Messages::GoToRunning); } - if (currentApp == Apps::Timer) { - lv_disp_trig_activity(nullptr); - auto* timer = static_cast<Screens::Timer*>(currentScreen.get()); - timer->Reset(); - } else { + // Load timer app if not loaded + if (currentApp != Apps::Timer) { LoadNewScreen(Apps::Timer, DisplayApp::FullRefreshDirections::Up); } - motorController.RunForDuration(35); + // Set the timer to ringing mode + lv_disp_trig_activity(nullptr); + auto* timerScreen = static_cast<Screens::Timer*>(currentScreen.get()); + timerScreen->SetTimerRinging(); + motorController.StartRinging(); break; + } case Messages::AlarmTriggered: if (currentApp == Apps::Alarm) { auto* alarm = static_cast<Screens::Alarm*>(currentScreen.get()); |
