Made the faces I care about not need to continuously re-find the timezone
This commit is contained in:
@@ -154,6 +154,7 @@ void world_clock2_face_activate(movement_settings_t *settings, void *context)
|
||||
movement_request_tick_frequency(4);
|
||||
break;
|
||||
}
|
||||
state->tz = get_timezone_offset(settings->bit.time_zone, watch_rtc_get_date_time());
|
||||
refresh_face = true;
|
||||
}
|
||||
|
||||
@@ -165,7 +166,6 @@ static bool mode_display(movement_event_t event, movement_settings_t *settings,
|
||||
uint32_t timestamp;
|
||||
uint32_t previous_date_time;
|
||||
watch_date_time date_time;
|
||||
int16_t tz;
|
||||
|
||||
switch (event.event_type) {
|
||||
case EVENT_ACTIVATE:
|
||||
@@ -184,9 +184,8 @@ static bool mode_display(movement_event_t event, movement_settings_t *settings,
|
||||
|
||||
/* Determine current time at time zone and store date/time */
|
||||
date_time = watch_rtc_get_date_time();
|
||||
tz = get_timezone_offset(settings->bit.time_zone, date_time);
|
||||
timestamp = watch_utility_date_time_to_unix_time(date_time, tz * 60);
|
||||
date_time = watch_utility_date_time_from_unix_time(timestamp, tz * 60);
|
||||
timestamp = watch_utility_date_time_to_unix_time(date_time, state->tz * 60);
|
||||
date_time = watch_utility_date_time_from_unix_time(timestamp, state->tz * 60);
|
||||
previous_date_time = state->previous_date_time;
|
||||
state->previous_date_time = date_time.reg;
|
||||
|
||||
@@ -286,7 +285,7 @@ static bool mode_settings(movement_event_t event, movement_settings_t *settings,
|
||||
watch_clear_indicator(WATCH_INDICATOR_PM);
|
||||
refresh_face = false;
|
||||
}
|
||||
result = div(get_timezone_offset(state->current_zone, watch_rtc_get_date_time()), 60);
|
||||
result = div(state->tz, 60);
|
||||
hours = result.quot;
|
||||
minutes = result.rem;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user