Skip to content

Commit

Permalink
Included logic on clock_face and changed the time view on preferences
Browse files Browse the repository at this point in the history
  • Loading branch information
voloved committed Sep 3, 2024
1 parent 138a654 commit dcafdea
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 4 additions & 0 deletions movement/watch_faces/clock/clock_face.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,10 @@ bool clock_face_wants_background_task(movement_settings_t *settings, void *conte
if (!state->time_signal_enabled) return false;

watch_date_time date_time = watch_rtc_get_date_time();
uint8_t chime_start = Hourly_Chime_Start[settings->bit.hourly_chime_start];
uint8_t chime_end = Hourly_Chime_End[settings->bit.hourly_chime_end];
if (chime_end == 0) chime_end = 24;
if (!settings->bit.hourly_chime_always && (date_time.unit.hour < chime_start || date_time.unit.hour >= chime_end)) return false;

return date_time.unit.minute == 0;
}
11 changes: 7 additions & 4 deletions movement/watch_faces/settings/preferences_face.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ void preferences_face_activate(movement_settings_t *settings, void *context) {
}

static void _watch_display_hourly_chime_string(movement_settings_t *settings, uint8_t hour){
char buf[4];
char buf[6];
if (settings->bit.hourly_chime_always){
watch_clear_indicator(WATCH_INDICATOR_PM);
watch_display_string(" Always", 4);
}
else{
Expand All @@ -72,10 +73,11 @@ static void _watch_display_hourly_chime_string(movement_settings_t *settings, ui
if (hour == 0) hour = 12;
}
if (hour > 9)
sprintf(buf, "%2d", hour);
sprintf(buf, "%2d00", hour);
else
sprintf(buf, " %d", hour);
watch_display_string(buf, 6);
sprintf(buf, " %d00", hour);
watch_set_colon();
watch_display_string(buf, 4);
}
}

Expand Down Expand Up @@ -158,6 +160,7 @@ bool preferences_face_loop(movement_event_t event, movement_settings_t *settings
watch_display_string((char *)preferences_face_titles[current_page], 0);

// blink active setting on even-numbered quarter-seconds
watch_clear_colon();
if (event.subsecond % 2) {
char buf[8];
switch (current_page) {
Expand Down

0 comments on commit dcafdea

Please sign in to comment.