Return to main alarm after 1 minute of awareness alarm
This commit is contained in:
+6
-4
@@ -172,7 +172,6 @@ static bool schedule_alarm(WakeupReason schedule_reason) {
|
|||||||
status = wakeup_schedule_simple_robust(target, 15, schedule_reason);
|
status = wakeup_schedule_simple_robust(target, 15, schedule_reason);
|
||||||
if (s_alarming_for_awareness) {
|
if (s_alarming_for_awareness) {
|
||||||
persist_write_bool(STORAGE_KEY_ALARMING_FOR_AWARENESS, false);
|
persist_write_bool(STORAGE_KEY_ALARMING_FOR_AWARENESS, false);
|
||||||
s_alarming_for_awareness = false;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case AWARENESS_ALARM:
|
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);
|
status = wakeup_schedule_simple_robust(target, SECONDS_PER_MINUTE, schedule_reason);
|
||||||
if (!s_alarming_for_awareness) {
|
if (!s_alarming_for_awareness) {
|
||||||
persist_write_bool(STORAGE_KEY_ALARMING_FOR_AWARENESS, true);
|
persist_write_bool(STORAGE_KEY_ALARMING_FOR_AWARENESS, true);
|
||||||
s_alarming_for_awareness = true;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MAIN_ALARM: {
|
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);
|
status = wakeup_schedule_simple_robust(target, SECONDS_PER_MINUTE, schedule_reason);
|
||||||
if (s_alarming_for_awareness) {
|
if (s_alarming_for_awareness) {
|
||||||
persist_write_bool(STORAGE_KEY_ALARMING_FOR_AWARENESS, false);
|
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) {
|
if (s_stopwatch_time[1] == 59) {
|
||||||
s_stopwatch_time[1] = 0;
|
s_stopwatch_time[1] = 0;
|
||||||
s_stopwatch_time[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 {
|
} else {
|
||||||
s_stopwatch_time[1]++;
|
s_stopwatch_time[1]++;
|
||||||
}
|
}
|
||||||
@@ -655,7 +657,7 @@ static void alarm_select_hold_handler(void *recognizer, void *ctx) {
|
|||||||
push_status_window(0);
|
push_status_window(0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// otherwise, set awareness alarm
|
// otherwise, set awareness alarm and exit
|
||||||
if (schedule_alarm(AWARENESS_ALARM)) {
|
if (schedule_alarm(AWARENESS_ALARM)) {
|
||||||
window_stack_pop_all(true);
|
window_stack_pop_all(true);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user