Skip to content

Commit ea3fccc

Browse files
committed
Timer: ringing
1 parent 525e7b9 commit ea3fccc

4 files changed

Lines changed: 10 additions & 6 deletions

File tree

src/components/timer/TimerController.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ void TimerController::StopTimer() {
4949
overtime = false;
5050
}
5151

52+
void TimerController::StopAlerting() {
53+
if (systemTask != nullptr) {
54+
systemTask->PushMessage(System::Messages::StopRinging);
55+
}
56+
}
57+
5258
void TimerController::OnTimerEnd() {
5359
overtime = true;
5460
if (systemTask != nullptr) {

src/components/timer/TimerController.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,13 @@ namespace Pinetime {
1515
TimerController() = default;
1616

1717
void Init();
18-
1918
void StartTimer(uint32_t duration);
20-
2119
void StopTimer();
22-
20+
void StopAlerting();
2321
int32_t GetSecondsRemaining();
24-
2522
bool IsOvertime() {
2623
return overtime;
2724
}
28-
2925
bool IsRunning() {
3026
return timerRunning;
3127
}

src/displayapp/screens/Timer.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ void Timer::stop() {
6060
secondsToSet = secondsRemaining % 60;
6161
}
6262
timerController.StopTimer();
63+
timerController.StopAlerting();
6364
lv_obj_set_style_local_text_color(time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GRAY);
6465
lv_label_set_text_fmt(time, "%02lu:%02lu", secondsRemaining / 60, secondsRemaining % 60);
6566
lv_label_set_text(txtPlayPause, Symbols::play);
@@ -106,6 +107,7 @@ Timer::~Timer() {
106107
lv_obj_clean(lv_scr_act());
107108
if (timerController.IsRunning() && timerController.IsOvertime()) {
108109
timerController.StopTimer();
110+
timerController.StopAlerting();
109111
}
110112
}
111113

src/systemtask/SystemTask.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ void SystemTask::Work() {
310310
if (isSleeping && !isWakingUp) {
311311
GoToRunning();
312312
}
313-
motorController.RunForDuration(35);
313+
motorController.StartRinging();
314314
displayApp.PushMessage(Pinetime::Applications::Display::Messages::TimerDone);
315315
break;
316316
case Messages::SetOffAlarm:

0 commit comments

Comments
 (0)