diff --git a/src/displayapp/screens/StopWatch.cpp b/src/displayapp/screens/StopWatch.cpp index 5265455bcb..6fa8165225 100644 --- a/src/displayapp/screens/StopWatch.cpp +++ b/src/displayapp/screens/StopWatch.cpp @@ -203,11 +203,7 @@ void StopWatch::PlayPauseBtnEventHandler() { DisplayStarted(); wakeLock.Lock(); } else if (stopWatchController.IsRunning()) { - stopWatchController.Pause(); - blinkTime = xTaskGetTickCount() + blinkInterval; - DisplayPaused(); - RenderTime(); - wakeLock.Release(); + OnPause(); } } @@ -224,10 +220,16 @@ void StopWatch::StopLapBtnEventHandler() { bool StopWatch::OnButtonPushed() { if (stopWatchController.IsRunning()) { - stopWatchController.Pause(); - DisplayPaused(); - wakeLock.Release(); + OnPause(); return true; } return false; } + +void StopWatch::OnPause() { + stopWatchController.Pause(); + blinkTime = xTaskGetTickCount() + blinkInterval; + RenderTime(); // make sure displayed time is not stale + DisplayPaused(); + wakeLock.Release(); +} \ No newline at end of file diff --git a/src/displayapp/screens/StopWatch.h b/src/displayapp/screens/StopWatch.h index e649485693..200f0192e2 100644 --- a/src/displayapp/screens/StopWatch.h +++ b/src/displayapp/screens/StopWatch.h @@ -29,6 +29,8 @@ namespace Pinetime::Applications { bool OnButtonPushed() override; private: + void OnPause(); + void DisplayPaused(); void DisplayStarted(); void DisplayCleared();