Skip to content

Commit e609966

Browse files
committed
Included logic on clock_face and changed the time view on preferences
1 parent 1342381 commit e609966

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

movement/watch_faces/clock/clock_face.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,10 @@ bool clock_face_wants_background_task(movement_settings_t *settings, void *conte
286286
if (!state->time_signal_enabled) return false;
287287

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

290294
return date_time.unit.minute == 0;
291295
}

movement/watch_faces/settings/preferences_face.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ void preferences_face_activate(movement_settings_t *settings, void *context) {
5656
}
5757

5858
static void _watch_display_hourly_chime_string(movement_settings_t *settings, uint8_t hour){
59-
char buf[4];
59+
char buf[6];
6060
if (settings->bit.hourly_chime_always){
61+
watch_clear_indicator(WATCH_INDICATOR_PM);
6162
watch_display_string(" Always", 4);
6263
}
6364
else{
@@ -72,10 +73,11 @@ static void _watch_display_hourly_chime_string(movement_settings_t *settings, ui
7273
if (hour == 0) hour = 12;
7374
}
7475
if (hour > 9)
75-
sprintf(buf, "%2d", hour);
76+
sprintf(buf, "%2d00", hour);
7677
else
77-
sprintf(buf, " %d", hour);
78-
watch_display_string(buf, 6);
78+
sprintf(buf, " %d00", hour);
79+
watch_set_colon();
80+
watch_display_string(buf, 4);
7981
}
8082
}
8183

@@ -156,6 +158,7 @@ bool preferences_face_loop(movement_event_t event, movement_settings_t *settings
156158
watch_display_string((char *)preferences_face_titles[current_page], 0);
157159

158160
// blink active setting on even-numbered quarter-seconds
161+
watch_clear_colon();
159162
if (event.subsecond % 2) {
160163
char buf[8];
161164
switch (current_page) {

0 commit comments

Comments
 (0)