Skip to content

Commit

Permalink
french_revolutionary face: fix compiler warning and uninitialized dat…
Browse files Browse the repository at this point in the history
…e_time variable
  • Loading branch information
CarpeNoctem authored and matheusmoreira committed Sep 7, 2024
1 parent 82ed355 commit 07a2a49
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions movement/watch_faces/clock/french_revolutionary_face.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

void french_revolutionary_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
(void) settings;
(void) watch_face_index;
if (*context_ptr == NULL) {
*context_ptr = malloc(sizeof(french_revolutionary_state_t));
memset(*context_ptr, 0, sizeof(french_revolutionary_state_t));
Expand Down Expand Up @@ -64,7 +65,7 @@ bool french_revolutionary_face_loop(movement_event_t event, movement_settings_t
break;
case EVENT_TICK:
case EVENT_LOW_ENERGY_UPDATE:

date_time = watch_rtc_get_date_time();

decimal_time = get_decimal_time(&date_time);
Expand Down Expand Up @@ -107,6 +108,7 @@ bool french_revolutionary_face_loop(movement_event_t event, movement_settings_t
state->use_am_pm = !state->use_am_pm;
if (state->use_am_pm) {
watch_clear_indicator(WATCH_INDICATOR_24H);
date_time = watch_rtc_get_date_time();
if (date_time.unit.hour < 12) { watch_clear_indicator(WATCH_INDICATOR_PM); }
else { watch_set_indicator(WATCH_INDICATOR_PM); }
} else {
Expand Down Expand Up @@ -240,4 +242,4 @@ char fix_character_one(char digit) {
break;
}
return return_char;
}
}

0 comments on commit 07a2a49

Please sign in to comment.