Use wakeup handler to reschedule fallback alarm

This commit is contained in:
2026-08-10 20:59:02 -04:00
parent 95aafa98b9
commit 5911295363
2 changed files with 10 additions and 7 deletions
+8 -5
View File
@@ -157,11 +157,6 @@ static void add_bar_layers_to_window(Layer *window_layer, bool small_top) {
////////////////////// ALARM //////////////////////
static void alarm_seconds_handler(struct tm *tick_time, TimeUnits units_changed) {
// re-schedule fallback alarm every 15 seconds
if (tick_time->tm_sec % 15 == 0) {
schedule_alarm(true); // output is not captured, as it is not actionable
}
// update stopwatch
if (s_stopwatch_time[1] == 59) {
s_stopwatch_time[1] = 0;
@@ -259,7 +254,15 @@ static void drop_menu_window_unload(Window *window) {
s_drop_menu_layer = NULL;
}
static void live_wakeup_handler_for_alarm(WakeupId id, int32_t reason) {
if (reason == 1) { // if fallback alarm, re-schedule it
schedule_alarm(true); // output is not captured, as it is not actionable
}
}
static void alarm_window_load() {
wakeup_service_subscribe(live_wakeup_handler_for_alarm);
Layer *window_layer = window_get_root_layer(s_window);
// change highlight color to avoid changing color of bottom bar