allow watch faces to advise of other things in addition to needing a background task

This commit is contained in:
joeycastillo
2024-09-29 21:43:07 -04:00
parent 40455847a3
commit f843156968
4 changed files with 39 additions and 21 deletions

View File

@@ -277,11 +277,14 @@ void clock_face_resign(void *context) {
(void) context;
}
bool clock_face_wants_background_task(void *context) {
movement_watch_face_advisory_t clock_face_advise(void *context) {
movement_watch_face_advisory_t retval = { 0 };
clock_state_t *state = (clock_state_t *) context;
if (!state->time_signal_enabled) return false;
watch_date_time date_time = watch_rtc_get_date_time();
if (state->time_signal_enabled) {
watch_date_time date_time = watch_rtc_get_date_time();
retval.wants_background_task = date_time.unit.minute == 0;
}
return date_time.unit.minute == 0;
return retval;
}