Return to main alarm after 1 minute of awareness alarm

This commit is contained in:
2026-08-13 22:59:45 -04:00
parent 857e18e5cb
commit a3c6b40bed
+6 -4
View File
@@ -172,7 +172,6 @@ static bool schedule_alarm(WakeupReason schedule_reason) {
status = wakeup_schedule_simple_robust(target, 15, schedule_reason);
if (s_alarming_for_awareness) {
persist_write_bool(STORAGE_KEY_ALARMING_FOR_AWARENESS, false);
s_alarming_for_awareness = false;
}
break;
case AWARENESS_ALARM:
@@ -181,7 +180,6 @@ static bool schedule_alarm(WakeupReason schedule_reason) {
status = wakeup_schedule_simple_robust(target, SECONDS_PER_MINUTE, schedule_reason);
if (!s_alarming_for_awareness) {
persist_write_bool(STORAGE_KEY_ALARMING_FOR_AWARENESS, true);
s_alarming_for_awareness = true;
}
break;
case MAIN_ALARM: {
@@ -198,7 +196,6 @@ static bool schedule_alarm(WakeupReason schedule_reason) {
status = wakeup_schedule_simple_robust(target, SECONDS_PER_MINUTE, schedule_reason);
if (s_alarming_for_awareness) {
persist_write_bool(STORAGE_KEY_ALARMING_FOR_AWARENESS, false);
s_alarming_for_awareness = false;
}
}
}
@@ -239,6 +236,11 @@ static void alarm_seconds_handler(struct tm *tick_time, TimeUnits units_changed)
if (s_stopwatch_time[1] == 59) {
s_stopwatch_time[1] = 0;
s_stopwatch_time[0]++;
// fall back to main alarm and resume vibes
// if the user fails to solve within a minute
if (s_alarming_for_awareness) {
s_alarming_for_awareness = false;
}
} else {
s_stopwatch_time[1]++;
}
@@ -655,7 +657,7 @@ static void alarm_select_hold_handler(void *recognizer, void *ctx) {
push_status_window(0);
}
} else {
// otherwise, set awareness alarm
// otherwise, set awareness alarm and exit
if (schedule_alarm(AWARENESS_ALARM)) {
window_stack_pop_all(true);
}