File tree 2 files changed +12
-8
lines changed
2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -203,11 +203,7 @@ void StopWatch::PlayPauseBtnEventHandler() {
203
203
DisplayStarted ();
204
204
wakeLock.Lock ();
205
205
} else if (stopWatchController.IsRunning ()) {
206
- stopWatchController.Pause ();
207
- blinkTime = xTaskGetTickCount () + blinkInterval;
208
- DisplayPaused ();
209
- RenderTime ();
210
- wakeLock.Release ();
206
+ OnPause ();
211
207
}
212
208
}
213
209
@@ -224,10 +220,16 @@ void StopWatch::StopLapBtnEventHandler() {
224
220
225
221
bool StopWatch::OnButtonPushed () {
226
222
if (stopWatchController.IsRunning ()) {
227
- stopWatchController.Pause ();
228
- DisplayPaused ();
229
- wakeLock.Release ();
223
+ OnPause ();
230
224
return true ;
231
225
}
232
226
return false ;
233
227
}
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 {
29
29
bool OnButtonPushed () override ;
30
30
31
31
private:
32
+ void OnPause ();
33
+
32
34
void DisplayPaused ();
33
35
void DisplayStarted ();
34
36
void DisplayCleared ();
You can’t perform that action at this time.
0 commit comments