Revert PR #470 - implement automatic DST toggling

The DST code has not yet been fully tested, the upcoming movement
refactor is upon us and it will integrate with the micro timezone
library anyway. Revert it so that next can be merged into main.

This reverts commit ac5bf8cfce, reversing
changes made to 5a8a49a8c7.
This commit is contained in:
Matheus Afonso Martins Moreira
2024-09-17 17:08:32 -03:00
parent 683032219e
commit a9d503b807
32 changed files with 165 additions and 296 deletions

View File

@@ -60,16 +60,15 @@ 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:
state->tz = get_timezone_offset(settings->bit.time_zone, watch_rtc_get_date_time());
if (settings->bit.clock_mode_24h) watch_set_indicator(WATCH_INDICATOR_24H);
if (settings->bit.clock_mode_24h && !settings->bit.clock_24h_leading_zero) watch_set_indicator(WATCH_INDICATOR_24H);
watch_set_colon();
state->previous_date_time = 0xFFFFFFFF;
// fall through
case EVENT_TICK:
case EVENT_LOW_ENERGY_UPDATE:
date_time = watch_rtc_get_date_time();
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_curr * 60);
timestamp = watch_utility_date_time_to_unix_time(date_time, movement_timezone_offsets[settings->bit.time_zone] * 60);
date_time = watch_utility_date_time_from_unix_time(timestamp, movement_timezone_offsets[state->settings.bit.timezone_index] * 60);
previous_date_time = state->previous_date_time;
state->previous_date_time = date_time.reg;
@@ -178,8 +177,8 @@ static bool _world_clock_face_do_settings_mode(movement_event_t event, movement_
sprintf(buf, "%c%c %3d%02d ",
movement_valid_position_0_chars[state->settings.bit.char_0],
movement_valid_position_1_chars[state->settings.bit.char_1],
(int8_t) (state->tz_curr / 60),
(int8_t) (state->tz_curr % 60) * (state->tz_curr < 0 ? -1 : 1));
(int8_t) (movement_timezone_offsets[state->settings.bit.timezone_index] / 60),
(int8_t) (movement_timezone_offsets[state->settings.bit.timezone_index] % 60) * (movement_timezone_offsets[state->settings.bit.timezone_index] < 0 ? -1 : 1));
watch_set_colon();
watch_clear_indicator(WATCH_INDICATOR_PM);