File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed
Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -203,11 +203,7 @@ void StopWatch::PlayPauseBtnEventHandler() {
203203 DisplayStarted ();
204204 wakeLock.Lock ();
205205 } else if (stopWatchController.IsRunning ()) {
206- stopWatchController.Pause ();
207- blinkTime = xTaskGetTickCount () + blinkInterval;
208- DisplayPaused ();
209- RenderTime ();
210- wakeLock.Release ();
206+ OnPause ();
211207 }
212208}
213209
@@ -224,10 +220,16 @@ void StopWatch::StopLapBtnEventHandler() {
224220
225221bool StopWatch::OnButtonPushed () {
226222 if (stopWatchController.IsRunning ()) {
227- stopWatchController.Pause ();
228- DisplayPaused ();
229- wakeLock.Release ();
223+ OnPause ();
230224 return true ;
231225 }
232226 return false ;
233227}
228+
229+ void StopWatch::OnPause () {
230+ stopWatchController.Pause ();
231+ blinkTime = xTaskGetTickCount () + blinkInterval;
232+ RenderTime (); // make sure displayed time is not stale
233+ DisplayPaused ();
234+ wakeLock.Release ();
235+ }
Original file line number Diff line number Diff line change @@ -29,6 +29,8 @@ namespace Pinetime::Applications {
2929 bool OnButtonPushed () override ;
3030
3131 private:
32+ void OnPause ();
33+
3234 void DisplayPaused ();
3335 void DisplayStarted ();
3436 void DisplayCleared ();
You can’t perform that action at this time.
0 commit comments