diff --git a/movement.c b/movement.c index d343961b..34452237 100644 --- a/movement.c +++ b/movement.c @@ -337,6 +337,14 @@ void movement_set_button_should_sound(bool value) { movement_state.settings.bit.button_should_sound = value; } +movement_clock_mode_t movement_clock_mode_24h(void) { + return movement_state.settings.bit.clock_mode_24h ? MOVEMENT_CLOCK_MODE_24H : MOVEMENT_CLOCK_MODE_12H; +} + +void movement_set_clock_mode_24h(movement_clock_mode_t value) { + movement_state.settings.bit.clock_mode_24h = (value == MOVEMENT_CLOCK_MODE_24H); +} + void app_init(void) { _watch_init(); diff --git a/movement.h b/movement.h index 661373cb..a071f94e 100644 --- a/movement.h +++ b/movement.h @@ -41,6 +41,12 @@ // stuff we'll want to make available to all watch faces and stash in the BKUP[3] register. // This allows these preferences to be stored before entering BACKUP mode and and restored after waking from reset. +typedef enum { + MOVEMENT_CLOCK_MODE_12H = 0, + MOVEMENT_CLOCK_MODE_24H, + MOVEMENT_NUM_CLOCK_MODES +} movement_clock_mode_t; + // movement_settings_t contains global settings that cover watch behavior, including preferences around clock and unit // display, time zones, buzzer behavior, LED color and low energy mode timeouts. typedef union { @@ -321,3 +327,6 @@ int32_t movement_get_current_timezone_offset(void); bool movement_button_should_sound(void); void movement_set_button_should_sound(bool value); + +movement_clock_mode_t movement_clock_mode_24h(void); +void movement_set_clock_mode_24h(movement_clock_mode_t value); diff --git a/movement/watch_faces/clock/clock_face.c b/movement/watch_faces/clock/clock_face.c index 4de602b0..64a2bcd8 100644 --- a/movement/watch_faces/clock/clock_face.c +++ b/movement/watch_faces/clock/clock_face.c @@ -53,11 +53,7 @@ typedef struct { } clock_state_t; static bool clock_is_in_24h_mode(movement_settings_t *settings) { -#ifdef CLOCK_FACE_24H_ONLY - return true; -#else - return settings->bit.clock_mode_24h; -#endif + return movement_clock_mode_24h(); } static bool clock_should_set_leading_zero(movement_settings_t *settings) { @@ -89,7 +85,7 @@ static bool clock_is_pm(watch_date_time date_time) { } static void clock_indicate_pm(movement_settings_t *settings, watch_date_time date_time) { - if (settings->bit.clock_mode_24h) { return; } + if (movement_clock_mode_24h()) { return; } clock_indicate(WATCH_INDICATOR_PM, clock_is_pm(date_time)); } diff --git a/movement/watch_faces/clock/close_enough_clock_face.c b/movement/watch_faces/clock/close_enough_clock_face.c index cbd62e27..0ca4b809 100644 --- a/movement/watch_faces/clock/close_enough_clock_face.c +++ b/movement/watch_faces/clock/close_enough_clock_face.c @@ -77,7 +77,7 @@ void close_enough_clock_face_activate(movement_settings_t *settings, void *conte watch_stop_tick_animation(); } - if (settings->bit.clock_mode_24h) { + if (movement_clock_mode_24h()) { watch_set_indicator(WATCH_INDICATOR_24H); } @@ -155,7 +155,7 @@ bool close_enough_clock_face_loop(movement_event_t event, movement_settings_t *s close_enough_hour = (close_enough_hour + 1) % 24; } - if (!settings->bit.clock_mode_24h) { + if (!movement_clock_mode_24h()) { // if we are in 12 hour mode, do some cleanup. if (close_enough_hour < 12) { watch_clear_indicator(WATCH_INDICATOR_PM); diff --git a/movement/watch_faces/clock/french_revolutionary_face.c b/movement/watch_faces/clock/french_revolutionary_face.c index da94fc97..34ef6f1e 100644 --- a/movement/watch_faces/clock/french_revolutionary_face.c +++ b/movement/watch_faces/clock/french_revolutionary_face.c @@ -102,7 +102,7 @@ bool french_revolutionary_face_loop(movement_event_t event, movement_settings_t else { watch_display_string("--", 8); } break; case EVENT_LIGHT_LONG_PRESS: - // In case anyone really wants that upper time in 12-hour format. I thought about using the global setting (settings->bit.clock_mode_24h) + // In case anyone really wants that upper time in 12-hour format. I thought about using the global setting (movement_clock_mode_24h()) // for this preference, but thought someone who prefers 12-hour format normally, might prefer 24hr when compared to a 10hr decimal day, // so this is separate for now. state->use_am_pm = !state->use_am_pm; diff --git a/movement/watch_faces/clock/minimal_clock_face.c b/movement/watch_faces/clock/minimal_clock_face.c index fa4880e1..03ea6c41 100644 --- a/movement/watch_faces/clock/minimal_clock_face.c +++ b/movement/watch_faces/clock/minimal_clock_face.c @@ -30,7 +30,7 @@ static void _minimal_clock_face_update_display(movement_settings_t *settings) { watch_date_time date_time = watch_rtc_get_date_time(); char buffer[11]; - if (!settings->bit.clock_mode_24h) { + if (!movement_clock_mode_24h()) { date_time.unit.hour %= 12; sprintf(buffer, "%2d%02d ", date_time.unit.hour, date_time.unit.minute); } else { diff --git a/movement/watch_faces/clock/minute_repeater_decimal_face.c b/movement/watch_faces/clock/minute_repeater_decimal_face.c index 2cedc307..8a745e3e 100644 --- a/movement/watch_faces/clock/minute_repeater_decimal_face.c +++ b/movement/watch_faces/clock/minute_repeater_decimal_face.c @@ -83,7 +83,7 @@ void minute_repeater_decimal_face_activate(movement_settings_t *settings, void * if (watch_tick_animation_is_running()) watch_stop_tick_animation(); - if (settings->bit.clock_mode_24h) watch_set_indicator(WATCH_INDICATOR_24H); + if (movement_clock_mode_24h()) watch_set_indicator(WATCH_INDICATOR_24H); // handle chime indicator if (state->signal_enabled) watch_set_indicator(WATCH_INDICATOR_BELL); @@ -138,7 +138,7 @@ bool minute_repeater_decimal_face_loop(movement_event_t event, movement_settings sprintf(buf, "%02d%02d", date_time.unit.minute, date_time.unit.second); } else { // other stuff changed; let's do it all. - if (!settings->bit.clock_mode_24h) { + if (!movement_clock_mode_24h()) { // if we are in 12 hour mode, do some cleanup. if (date_time.unit.hour < 12) { watch_clear_indicator(WATCH_INDICATOR_PM); @@ -183,7 +183,7 @@ bool minute_repeater_decimal_face_loop(movement_event_t event, movement_settings int minutes = date_time.unit.minute % 10; // chiming hours - if (!settings->bit.clock_mode_24h) { + if (!movement_clock_mode_24h()) { hours = date_time.unit.hour % 12; if (hours == 0) hours = 12; } diff --git a/movement/watch_faces/clock/repetition_minute_face.c b/movement/watch_faces/clock/repetition_minute_face.c index e9e5e319..27c2346c 100644 --- a/movement/watch_faces/clock/repetition_minute_face.c +++ b/movement/watch_faces/clock/repetition_minute_face.c @@ -68,7 +68,7 @@ void repetition_minute_face_activate(movement_settings_t *settings, void *contex if (watch_tick_animation_is_running()) watch_stop_tick_animation(); - if (settings->bit.clock_mode_24h) watch_set_indicator(WATCH_INDICATOR_24H); + if (movement_clock_mode_24h()) watch_set_indicator(WATCH_INDICATOR_24H); // handle chime indicator if (state->signal_enabled) watch_set_indicator(WATCH_INDICATOR_BELL); @@ -123,7 +123,7 @@ bool repetition_minute_face_loop(movement_event_t event, movement_settings_t *se sprintf(buf, "%02d%02d", date_time.unit.minute, date_time.unit.second); } else { // other stuff changed; let's do it all. - if (!settings->bit.clock_mode_24h) { + if (!movement_clock_mode_24h()) { // if we are in 12 hour mode, do some cleanup. if (date_time.unit.hour < 12) { watch_clear_indicator(WATCH_INDICATOR_PM); @@ -170,7 +170,7 @@ bool repetition_minute_face_loop(movement_event_t event, movement_settings_t *se int minutes = date_time.unit.minute % 15; // chiming hours - if (!settings->bit.clock_mode_24h) { + if (!movement_clock_mode_24h()) { hours = date_time.unit.hour % 12; if (hours == 0) hours = 12; } diff --git a/movement/watch_faces/clock/simple_clock_bin_led_face.c b/movement/watch_faces/clock/simple_clock_bin_led_face.c index cf39c188..263efedb 100644 --- a/movement/watch_faces/clock/simple_clock_bin_led_face.c +++ b/movement/watch_faces/clock/simple_clock_bin_led_face.c @@ -60,7 +60,7 @@ void simple_clock_bin_led_face_activate(movement_settings_t *settings, void *con if (watch_tick_animation_is_running()) watch_stop_tick_animation(); - if (settings->bit.clock_mode_24h) watch_set_indicator(WATCH_INDICATOR_24H); + if (movement_clock_mode_24h()) watch_set_indicator(WATCH_INDICATOR_24H); // handle chime indicator if (state->signal_enabled) watch_set_indicator(WATCH_INDICATOR_BELL); @@ -149,7 +149,7 @@ bool simple_clock_bin_led_face_loop(movement_event_t event, movement_settings_t sprintf(buf, "%02d%02d", date_time.unit.minute, date_time.unit.second); } else { // other stuff changed; let's do it all. - if (!settings->bit.clock_mode_24h) { + if (!movement_clock_mode_24h()) { // if we are in 12 hour mode, do some cleanup. if (date_time.unit.hour < 12) { watch_clear_indicator(WATCH_INDICATOR_PM); @@ -187,7 +187,7 @@ bool simple_clock_bin_led_face_loop(movement_event_t event, movement_settings_t date_time = watch_rtc_get_date_time(); state->flashing_state = 1 + 128; state->ticks = 4; - if (!settings->bit.clock_mode_24h) { + if (!movement_clock_mode_24h()) { date_time.unit.hour %= 12; if (date_time.unit.hour == 0) date_time.unit.hour = 12; } diff --git a/movement/watch_faces/clock/weeknumber_clock_face.c b/movement/watch_faces/clock/weeknumber_clock_face.c index 81df5847..9941858c 100644 --- a/movement/watch_faces/clock/weeknumber_clock_face.c +++ b/movement/watch_faces/clock/weeknumber_clock_face.c @@ -50,7 +50,7 @@ void weeknumber_clock_face_activate(movement_settings_t *settings, void *context if (watch_tick_animation_is_running()) watch_stop_tick_animation(); - if (settings->bit.clock_mode_24h) watch_set_indicator(WATCH_INDICATOR_24H); + if (movement_clock_mode_24h()) watch_set_indicator(WATCH_INDICATOR_24H); // handle chime indicator if (state->signal_enabled) watch_set_indicator(WATCH_INDICATOR_BELL); @@ -100,7 +100,7 @@ bool weeknumber_clock_face_loop(movement_event_t event, movement_settings_t *set sprintf(buf, "%02d%02d", date_time.unit.minute, watch_utility_get_weeknumber(date_time.unit.year, date_time.unit.month, date_time.unit.day)); } else { // other stuff changed; let's do it all. - if (!settings->bit.clock_mode_24h) { + if (!movement_clock_mode_24h()) { // if we are in 12 hour mode, do some cleanup. if (date_time.unit.hour < 12) { watch_clear_indicator(WATCH_INDICATOR_PM); diff --git a/movement/watch_faces/clock/world_clock2_face.c b/movement/watch_faces/clock/world_clock2_face.c index b678bdd9..7fa86d28 100644 --- a/movement/watch_faces/clock/world_clock2_face.c +++ b/movement/watch_faces/clock/world_clock2_face.c @@ -174,7 +174,7 @@ static bool mode_display(movement_event_t event, movement_settings_t *settings, if (refresh_face) { watch_clear_indicator(WATCH_INDICATOR_SIGNAL); watch_set_colon(); - if (settings->bit.clock_mode_24h) + if (movement_clock_mode_24h()) watch_set_indicator(WATCH_INDICATOR_24H); state->previous_date_time = REFRESH_TIME; @@ -198,7 +198,7 @@ static bool mode_display(movement_event_t event, movement_settings_t *settings, sprintf(buf, "%02d%02d", date_time.unit.minute, date_time.unit.second); } else { /* Other stuff changed; Let's do it all. */ - if (!settings->bit.clock_mode_24h) { + if (!movement_clock_mode_24h()) { /* If we are in 12 hour mode, do some cleanup. */ if (date_time.unit.hour < 12) { watch_clear_indicator(WATCH_INDICATOR_PM); diff --git a/movement/watch_faces/complication/activity_face.c b/movement/watch_faces/complication/activity_face.c index 136352f7..c7399c2d 100644 --- a/movement/watch_faces/complication/activity_face.c +++ b/movement/watch_faces/complication/activity_face.c @@ -296,7 +296,7 @@ static void _activity_update_logging_screen(movement_settings_t *settings, activ watch_clear_indicator(WATCH_INDICATOR_LAP); watch_date_time now = watch_rtc_get_date_time(); uint8_t hour = now.unit.hour; - if (!settings->bit.clock_mode_24h) { + if (!movement_clock_mode_24h()) { watch_clear_indicator(WATCH_INDICATOR_24H); if (hour < 12) watch_clear_indicator(WATCH_INDICATOR_PM); diff --git a/movement/watch_faces/complication/alarm_face.c b/movement/watch_faces/complication/alarm_face.c index 6a949cba..a123f0e0 100644 --- a/movement/watch_faces/complication/alarm_face.c +++ b/movement/watch_faces/complication/alarm_face.c @@ -73,7 +73,7 @@ static void _alarm_face_draw(movement_settings_t *settings, alarm_state_t *state } //handle am/pm for hour display uint8_t h = state->alarm[state->alarm_idx].hour; - if (!settings->bit.clock_mode_24h) { + if (!movement_clock_mode_24h()) { if (h >= 12) { watch_set_indicator(WATCH_INDICATOR_PM); h %= 12; diff --git a/movement/watch_faces/complication/deadline_face.c b/movement/watch_faces/complication/deadline_face.c index c30229c1..8e2f41ea 100644 --- a/movement/watch_faces/complication/deadline_face.c +++ b/movement/watch_faces/complication/deadline_face.c @@ -448,7 +448,7 @@ static void _setting_display(movement_event_t event, movement_settings_t *settin int i = state->current_index + 1; if (state->current_page > 2) { watch_set_colon(); - if (settings->bit.clock_mode_24h) { + if (movement_clock_mode_24h()) { watch_set_indicator(WATCH_INDICATOR_24H); sprintf(buf, "%s%2d%2d%02d ", settings_titles[state->current_page], i, date_time.unit.hour, date_time.unit.minute); } else { diff --git a/movement/watch_faces/complication/endless_runner_face.c b/movement/watch_faces/complication/endless_runner_face.c index 3509fc22..6d8b4873 100644 --- a/movement/watch_faces/complication/endless_runner_face.c +++ b/movement/watch_faces/complication/endless_runner_face.c @@ -602,7 +602,7 @@ bool endless_runner_face_loop(movement_event_t event, movement_settings_t *setti display_title(state); break; case EVENT_LOW_ENERGY_UPDATE: - display_time(watch_rtc_get_date_time(), settings->bit.clock_mode_24h); + display_time(watch_rtc_get_date_time(), movement_clock_mode_24h()); break; default: return movement_default_loop_handler(event, settings); diff --git a/movement/watch_faces/complication/planetary_hours_face.c b/movement/watch_faces/complication/planetary_hours_face.c index acded917..7c004491 100644 --- a/movement/watch_faces/complication/planetary_hours_face.c +++ b/movement/watch_faces/complication/planetary_hours_face.c @@ -253,7 +253,7 @@ static void _planetary_hours(movement_settings_t *settings, planetary_hours_stat return; } - if (settings->bit.clock_mode_24h) watch_set_indicator(WATCH_INDICATOR_24H); + if (movement_clock_mode_24h()) watch_set_indicator(WATCH_INDICATOR_24H); // roll over hour iterator if ( state->hour < 0 ) state->hour = 23; @@ -305,7 +305,7 @@ static void _planetary_hours(movement_settings_t *settings, planetary_hours_stat else if ( scratch_time.unit.minute < 59 ) scratch_time.unit.minute++; // if we are in 12 hour mode, do some cleanup - if (!settings->bit.clock_mode_24h) { + if (!movement_clock_mode_24h()) { if (scratch_time.unit.hour < 12) { watch_clear_indicator(WATCH_INDICATOR_PM); } else { diff --git a/movement/watch_faces/complication/planetary_time_face.c b/movement/watch_faces/complication/planetary_time_face.c index 56a18cf2..227f68d4 100644 --- a/movement/watch_faces/complication/planetary_time_face.c +++ b/movement/watch_faces/complication/planetary_time_face.c @@ -218,11 +218,11 @@ static void _planetary_time(movement_event_t event, movement_settings_t *setting return; } - if (settings->bit.clock_mode_24h) watch_set_indicator(WATCH_INDICATOR_24H); + if (movement_clock_mode_24h()) watch_set_indicator(WATCH_INDICATOR_24H); // PM for night hours, otherwise the night hours are counted from 13 if ( state->night ) { - if (settings->bit.clock_mode_24h) night_hour_count = 12; + if (movement_clock_mode_24h()) night_hour_count = 12; else watch_set_indicator(WATCH_INDICATOR_PM); } diff --git a/movement/watch_faces/complication/solstice_face.c b/movement/watch_faces/complication/solstice_face.c index e74f8789..c31223e9 100644 --- a/movement/watch_faces/complication/solstice_face.c +++ b/movement/watch_faces/complication/solstice_face.c @@ -165,7 +165,7 @@ static void show_main_screen(solstice_state_t *state) { static void show_date_time(movement_settings_t *settings, solstice_state_t *state) { char buf[11]; watch_date_time date_time = state->datetimes[state->index]; - if (!settings->bit.clock_mode_24h) { + if (!movement_clock_mode_24h()) { if (date_time.unit.hour < 12) { watch_clear_indicator(WATCH_INDICATOR_PM); } else { diff --git a/movement/watch_faces/complication/sunrise_sunset_face.c b/movement/watch_faces/complication/sunrise_sunset_face.c index fbf60cfe..7a0ba366 100644 --- a/movement/watch_faces/complication/sunrise_sunset_face.c +++ b/movement/watch_faces/complication/sunrise_sunset_face.c @@ -93,7 +93,7 @@ static void _sunrise_sunset_face_update(movement_settings_t *settings, sunrise_s } watch_set_colon(); - if (settings->bit.clock_mode_24h) watch_set_indicator(WATCH_INDICATOR_24H); + if (movement_clock_mode_24h()) watch_set_indicator(WATCH_INDICATOR_24H); rise += hours_from_utc; set += hours_from_utc; @@ -113,7 +113,7 @@ static void _sunrise_sunset_face_update(movement_settings_t *settings, sunrise_s if (date_time.reg < scratch_time.reg || show_next_match) { if (state->rise_index == 0 || show_next_match) { - if (!settings->bit.clock_mode_24h) { + if (!movement_clock_mode_24h()) { if (watch_utility_convert_to_12_hour(&scratch_time)) watch_set_indicator(WATCH_INDICATOR_PM); else watch_clear_indicator(WATCH_INDICATOR_PM); } @@ -140,7 +140,7 @@ static void _sunrise_sunset_face_update(movement_settings_t *settings, sunrise_s if (date_time.reg < scratch_time.reg || show_next_match) { if (state->rise_index == 0 || show_next_match) { - if (!settings->bit.clock_mode_24h) { + if (!movement_clock_mode_24h()) { if (watch_utility_convert_to_12_hour(&scratch_time)) watch_set_indicator(WATCH_INDICATOR_PM); else watch_clear_indicator(WATCH_INDICATOR_PM); } diff --git a/movement/watch_faces/complication/wake_face.c b/movement/watch_faces/complication/wake_face.c index 6fa801fa..79262563 100644 --- a/movement/watch_faces/complication/wake_face.c +++ b/movement/watch_faces/complication/wake_face.c @@ -38,7 +38,7 @@ void _wake_face_update_display(movement_settings_t *settings, wake_face_state_t uint8_t hour = state->hour; watch_clear_display(); - if ( settings->bit.clock_mode_24h ) + if ( movement_clock_mode_24h() ) watch_set_indicator(WATCH_INDICATOR_24H); else { if ( hour >= 12 ) diff --git a/movement/watch_faces/demo/lis2dw_logging_face.c b/movement/watch_faces/demo/lis2dw_logging_face.c index b76c134f..8cd62d7d 100644 --- a/movement/watch_faces/demo/lis2dw_logging_face.c +++ b/movement/watch_faces/demo/lis2dw_logging_face.c @@ -50,7 +50,7 @@ static void _lis2dw_logging_face_update_display(movement_settings_t *settings, l } else { date_time = logger_state->data[pos].timestamp; watch_set_colon(); - if (settings->bit.clock_mode_24h) { + if (movement_clock_mode_24h()) { watch_set_indicator(WATCH_INDICATOR_24H); } else { if (date_time.unit.hour > 11) watch_set_indicator(WATCH_INDICATOR_PM); diff --git a/movement/watch_faces/sensor/thermistor_logging_face.c b/movement/watch_faces/sensor/thermistor_logging_face.c index 64f605e9..63db33ce 100644 --- a/movement/watch_faces/sensor/thermistor_logging_face.c +++ b/movement/watch_faces/sensor/thermistor_logging_face.c @@ -100,18 +100,18 @@ bool thermistor_logging_face_loop(movement_event_t event, movement_settings_t *s break; case EVENT_LIGHT_BUTTON_DOWN: logger_state->ts_ticks = 2; - _thermistor_logging_face_update_display(logger_state, settings->bit.use_imperial_units, settings->bit.clock_mode_24h); + _thermistor_logging_face_update_display(logger_state, settings->bit.use_imperial_units, movement_clock_mode_24h()); break; case EVENT_ALARM_BUTTON_DOWN: logger_state->display_index = (logger_state->display_index + 1) % THERMISTOR_LOGGING_NUM_DATA_POINTS; logger_state->ts_ticks = 0; // fall through case EVENT_ACTIVATE: - _thermistor_logging_face_update_display(logger_state, settings->bit.use_imperial_units, settings->bit.clock_mode_24h); + _thermistor_logging_face_update_display(logger_state, settings->bit.use_imperial_units, movement_clock_mode_24h()); break; case EVENT_TICK: if (logger_state->ts_ticks && --logger_state->ts_ticks == 0) { - _thermistor_logging_face_update_display(logger_state, settings->bit.use_imperial_units, settings->bit.clock_mode_24h); + _thermistor_logging_face_update_display(logger_state, settings->bit.use_imperial_units, movement_clock_mode_24h()); } break; case EVENT_BACKGROUND_TASK: diff --git a/movement/watch_faces/settings/set_time_hackwatch_face.c b/movement/watch_faces/settings/set_time_hackwatch_face.c index 2f4c0341..9b96014f 100644 --- a/movement/watch_faces/settings/set_time_hackwatch_face.c +++ b/movement/watch_faces/settings/set_time_hackwatch_face.c @@ -191,7 +191,7 @@ bool set_time_hackwatch_face_loop(movement_event_t event, movement_settings_t *s char buf[11]; if (current_page < 3) { watch_set_colon(); - if (settings->bit.clock_mode_24h) { + if (movement_clock_mode_24h()) { watch_set_indicator(WATCH_INDICATOR_24H); sprintf(buf, "%s %2d%02d%02d", diff --git a/watch-faces/clock/simple_clock_face.c b/watch-faces/clock/simple_clock_face.c index d4fb963c..d3c27868 100644 --- a/watch-faces/clock/simple_clock_face.c +++ b/watch-faces/clock/simple_clock_face.c @@ -51,7 +51,7 @@ void simple_clock_face_activate(movement_settings_t *settings, void *context) { if (watch_tick_animation_is_running()) watch_stop_tick_animation(); - if (settings->bit.clock_mode_24h) watch_set_indicator(WATCH_INDICATOR_24H); + if (movement_clock_mode_24h()) watch_set_indicator(WATCH_INDICATOR_24H); // handle chime indicator if (state->signal_enabled) watch_set_indicator(WATCH_INDICATOR_BELL); @@ -106,7 +106,7 @@ bool simple_clock_face_loop(movement_event_t event, movement_settings_t *setting watch_display_text(WATCH_POSITION_SECONDS, buf + 2); } else { // other stuff changed; let's do it all. - if (!settings->bit.clock_mode_24h) { + if (!movement_clock_mode_24h()) { // if we are in 12 hour mode, do some cleanup. if (date_time.unit.hour < 12) { watch_clear_indicator(WATCH_INDICATOR_PM); diff --git a/watch-faces/clock/world_clock_face.c b/watch-faces/clock/world_clock_face.c index 924651b2..ddbcc94e 100644 --- a/watch-faces/clock/world_clock_face.c +++ b/watch-faces/clock/world_clock_face.c @@ -68,7 +68,7 @@ static bool world_clock_face_do_display_mode(movement_event_t event, movement_se watch_date_time date_time; switch (event.event_type) { case EVENT_ACTIVATE: - if (settings->bit.clock_mode_24h) watch_set_indicator(WATCH_INDICATOR_24H); + if (movement_clock_mode_24h()) watch_set_indicator(WATCH_INDICATOR_24H); watch_set_colon(); state->previous_date_time = 0xFFFFFFFF; // fall through @@ -93,7 +93,7 @@ static bool world_clock_face_do_display_mode(movement_event_t event, movement_se } } else { // other stuff changed; let's do it all. - if (!settings->bit.clock_mode_24h) { + if (!movement_clock_mode_24h()) { // if we are in 12 hour mode, do some cleanup. if (date_time.unit.hour < 12) { watch_clear_indicator(WATCH_INDICATOR_PM); diff --git a/watch-faces/settings/preferences_face.c b/watch-faces/settings/preferences_face.c index 07359451..344f0f35 100644 --- a/watch-faces/settings/preferences_face.c +++ b/watch-faces/settings/preferences_face.c @@ -84,7 +84,7 @@ bool preferences_face_loop(movement_event_t event, movement_settings_t *settings char buf[8]; switch (state->current_page) { case PREFERENCES_PAGE_CLOCK_MODE: - if (settings->bit.clock_mode_24h) watch_display_text(WATCH_POSITION_BOTTOM, "24h"); + if (movement_clock_mode_24h()) watch_display_text(WATCH_POSITION_BOTTOM, "24h"); else watch_display_text(WATCH_POSITION_BOTTOM, "12h"); break; case PREFERENCES_PAGE_BUTTON_SOUND: @@ -179,7 +179,7 @@ bool preferences_face_loop(movement_event_t event, movement_settings_t *settings case EVENT_ALARM_BUTTON_UP: switch (state->current_page) { case PREFERENCES_PAGE_CLOCK_MODE: - settings->bit.clock_mode_24h = !settings->bit.clock_mode_24h; + movement_set_clock_mode_24h(((movement_clock_mode_24h() + 1) % MOVEMENT_NUM_CLOCK_MODES)); break; case PREFERENCES_PAGE_BUTTON_SOUND: movement_set_button_should_sound(!movement_button_should_sound()); diff --git a/watch-faces/settings/set_time_face.c b/watch-faces/settings/set_time_face.c index c1c92577..ea627499 100644 --- a/watch-faces/settings/set_time_face.c +++ b/watch-faces/settings/set_time_face.c @@ -132,7 +132,7 @@ bool set_time_face_loop(movement_event_t event, movement_settings_t *settings, v watch_display_text(WATCH_POSITION_TOP_RIGHT, " "); if (current_page < 3) { watch_set_colon(); - if (settings->bit.clock_mode_24h) { + if (movement_clock_mode_24h()) { watch_set_indicator(WATCH_INDICATOR_24H); sprintf(buf, "%2d%02d%02d", date_time.unit.hour, date_time.unit.minute, date_time.unit.second); } else {