From 4e10930725dc82014bac2aeca330fd3a77a10c44 Mon Sep 17 00:00:00 2001 From: liamcharger Date: Sun, 31 Mar 2024 13:30:00 +1030 Subject: [PATCH 1/5] Initial commit --- src/displayapp/screens/StopWatch.cpp | 7 +++---- src/displayapp/screens/StopWatch.h | 6 ++---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/displayapp/screens/StopWatch.cpp b/src/displayapp/screens/StopWatch.cpp index f0359da4d4..9290d6af99 100644 --- a/src/displayapp/screens/StopWatch.cpp +++ b/src/displayapp/screens/StopWatch.cpp @@ -3,6 +3,8 @@ #include "displayapp/screens/Symbols.h" #include "displayapp/InfiniTimeTheme.h" +#include "systemtask/SystemTask.h" + using namespace Pinetime::Applications::Screens; namespace { @@ -34,7 +36,7 @@ namespace { constexpr TickType_t blinkInterval = pdMS_TO_TICKS(1000); } -StopWatch::StopWatch(System::SystemTask& systemTask) : systemTask {systemTask} { +StopWatch::StopWatch() { static constexpr uint8_t btnWidth = 115; static constexpr uint8_t btnHeight = 80; btnPlayPause = lv_btn_create(lv_scr_act(), nullptr); @@ -79,7 +81,6 @@ StopWatch::StopWatch(System::SystemTask& systemTask) : systemTask {systemTask} { StopWatch::~StopWatch() { lv_task_del(taskRefresh); - systemTask.PushMessage(Pinetime::System::Messages::EnableSleeping); lv_obj_clean(lv_scr_act()); } @@ -135,7 +136,6 @@ void StopWatch::Start() { SetInterfaceRunning(); startTime = xTaskGetTickCount(); currentState = States::Running; - systemTask.PushMessage(Pinetime::System::Messages::DisableSleeping); } void StopWatch::Pause() { @@ -145,7 +145,6 @@ void StopWatch::Pause() { oldTimeElapsed = laps[lapsDone]; blinkTime = xTaskGetTickCount() + blinkInterval; currentState = States::Halted; - systemTask.PushMessage(Pinetime::System::Messages::EnableSleeping); } void StopWatch::Refresh() { diff --git a/src/displayapp/screens/StopWatch.h b/src/displayapp/screens/StopWatch.h index 3386d042b8..a84e4943d1 100644 --- a/src/displayapp/screens/StopWatch.h +++ b/src/displayapp/screens/StopWatch.h @@ -6,7 +6,6 @@ #include #include "portmacro_cmsis.h" -#include "systemtask/SystemTask.h" #include "displayapp/apps/Apps.h" #include "displayapp/Controllers.h" #include "Symbols.h" @@ -26,7 +25,7 @@ namespace Pinetime { class StopWatch : public Screen { public: - explicit StopWatch(System::SystemTask& systemTask); + explicit StopWatch(); ~StopWatch() override; void Refresh() override; @@ -43,7 +42,6 @@ namespace Pinetime { void Start(); void Pause(); - Pinetime::System::SystemTask& systemTask; States currentState = States::Init; TickType_t startTime; TickType_t oldTimeElapsed = 0; @@ -66,7 +64,7 @@ namespace Pinetime { static constexpr const char* icon = Screens::Symbols::stopWatch; static Screens::Screen* Create(AppControllers& controllers) { - return new Screens::StopWatch(*controllers.systemTask); + return new Screens::StopWatch(); }; }; } From bc7c20c6da6babdcc77d52a8af79dbe21455e6e6 Mon Sep 17 00:00:00 2001 From: Liam Willey Date: Sun, 18 May 2025 13:06:49 -0400 Subject: [PATCH 2/5] Remove unnecessary include --- src/displayapp/screens/StopWatch.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/displayapp/screens/StopWatch.cpp b/src/displayapp/screens/StopWatch.cpp index 9290d6af99..7b70030138 100644 --- a/src/displayapp/screens/StopWatch.cpp +++ b/src/displayapp/screens/StopWatch.cpp @@ -3,8 +3,6 @@ #include "displayapp/screens/Symbols.h" #include "displayapp/InfiniTimeTheme.h" -#include "systemtask/SystemTask.h" - using namespace Pinetime::Applications::Screens; namespace { From c6199da20ebde9cf92b00a2d0209d313c6af7488 Mon Sep 17 00:00:00 2001 From: Liam Willey Date: Mon, 19 May 2025 16:17:44 -0400 Subject: [PATCH 3/5] Fix build error --- src/displayapp/screens/StopWatch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/displayapp/screens/StopWatch.cpp b/src/displayapp/screens/StopWatch.cpp index 7b70030138..fdd3104420 100644 --- a/src/displayapp/screens/StopWatch.cpp +++ b/src/displayapp/screens/StopWatch.cpp @@ -1,7 +1,7 @@ #include "displayapp/screens/StopWatch.h" - #include "displayapp/screens/Symbols.h" #include "displayapp/InfiniTimeTheme.h" +#include using namespace Pinetime::Applications::Screens; From 6063111479c5a102c441259523e4177264bac9f6 Mon Sep 17 00:00:00 2001 From: Liam Willey Date: Mon, 19 May 2025 16:35:52 -0400 Subject: [PATCH 4/5] Add required headers for sim --- src/displayapp/screens/StopWatch.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/displayapp/screens/StopWatch.cpp b/src/displayapp/screens/StopWatch.cpp index fdd3104420..2d321426d7 100644 --- a/src/displayapp/screens/StopWatch.cpp +++ b/src/displayapp/screens/StopWatch.cpp @@ -1,6 +1,7 @@ #include "displayapp/screens/StopWatch.h" #include "displayapp/screens/Symbols.h" #include "displayapp/InfiniTimeTheme.h" +#include #include using namespace Pinetime::Applications::Screens; From e78c94a6ce4a7c94d3585ae98c4e6da19704d3e7 Mon Sep 17 00:00:00 2001 From: Liam Willey Date: Mon, 19 May 2025 16:38:32 -0400 Subject: [PATCH 5/5] Add missing import --- src/displayapp/screens/StopWatch.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/displayapp/screens/StopWatch.cpp b/src/displayapp/screens/StopWatch.cpp index 2d321426d7..01f2170476 100644 --- a/src/displayapp/screens/StopWatch.cpp +++ b/src/displayapp/screens/StopWatch.cpp @@ -2,6 +2,7 @@ #include "displayapp/screens/Symbols.h" #include "displayapp/InfiniTimeTheme.h" #include +#include #include using namespace Pinetime::Applications::Screens;