]> git.earman.xyz Git - sensor-watch.git/commitdiff
Revert PR #470 - fixes world_clock2 face
authorMatheus Afonso Martins Moreira <matheus@matheusmoreira.com>
Tue, 17 Sep 2024 20:19:05 +0000 (17:19 -0300)
committerMatheus Afonso Martins Moreira <matheus@matheusmoreira.com>
Tue, 17 Sep 2024 20:28:41 +0000 (17:28 -0300)
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 3c86a42aa83356735be2bd84b7027b156e8d3a2c, reversing
changes made to be969c4deb144280b59d0293cc45dc3443b096cf.

movement/watch_faces/clock/world_clock2_face.c
movement/watch_faces/clock/world_clock_face.c

index 4d50552f2c45bc28765b86bc7f7a594798dd567d..5b3f8a9f34c6272ecdf84d486309892f350c607b 100644 (file)
@@ -238,16 +238,14 @@ static bool mode_display(movement_event_t event, movement_settings_t *settings,
            break;
        case EVENT_ALARM_BUTTON_UP:
            state->current_zone = find_selected_zone(state, FORWARD);
-        state->tz_curr = get_timezone_offset(state->current_zone, watch_rtc_get_date_time());
-        state->previous_date_time = REFRESH_TIME;
+            state->previous_date_time = REFRESH_TIME;
            break;
        case EVENT_LIGHT_BUTTON_DOWN:
            /* Do nothing. */
            break;
        case EVENT_LIGHT_BUTTON_UP:
            state->current_zone = find_selected_zone(state, BACKWARD);
-        state->tz_curr = get_timezone_offset(state->current_zone, watch_rtc_get_date_time());
-        state->previous_date_time = REFRESH_TIME;
+            state->previous_date_time = REFRESH_TIME;
            break;
        case EVENT_LIGHT_LONG_PRESS:
            movement_illuminate_led();
@@ -320,21 +318,17 @@ static bool mode_settings(movement_event_t event, movement_settings_t *settings,
            break;
        case EVENT_ALARM_BUTTON_UP:
            state->current_zone = mod(state->current_zone + FORWARD, NUM_TIME_ZONES);
-        state->tz_curr = get_timezone_offset(state->current_zone, watch_rtc_get_date_time());
            break;
        case EVENT_LIGHT_BUTTON_UP:
            state->current_zone = mod(state->current_zone + BACKWARD, NUM_TIME_ZONES);
-        state->tz_curr = get_timezone_offset(state->current_zone, watch_rtc_get_date_time());
            break;
        case EVENT_LIGHT_BUTTON_DOWN:
            /* Do nothing */
            break;
        case EVENT_ALARM_LONG_PRESS:
            /* Find next selected zone */
-           if (!state->zones[state->current_zone].selected) {
-            state->current_zone = find_selected_zone(state, FORWARD);
-            state->tz_curr = get_timezone_offset(state->current_zone, watch_rtc_get_date_time());
-        }
+           if (!state->zones[state->current_zone].selected)
+               state->current_zone = find_selected_zone(state, FORWARD);
 
            /* Switch to display mode */
            state->current_mode = WORLD_CLOCK2_MODE_DISPLAY;
index c324b5f0a5aefbe13c7bda46bbe18aae292dfaac..6b731e8e015bffb1dda06d33c5a6592d878f61c3 100644 (file)
@@ -162,7 +162,6 @@ static bool _world_clock_face_do_settings_mode(movement_event_t event, movement_
                 case 3:
                     state->settings.bit.timezone_index++;
                     if (state->settings.bit.timezone_index > 40) state->settings.bit.timezone_index = 0;
-                    state->tz_curr = get_timezone_offset(state->settings.bit.timezone_index, watch_rtc_get_date_time());
                     break;
             }
             break;