Revert PR #268 - add daylight savings time toggle
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 commit5a8a49a8c7, reversing changes made tobfadb81e82.
This commit is contained in:
@@ -27,8 +27,8 @@
|
||||
#include "watch.h"
|
||||
#include "watch_utility.h"
|
||||
|
||||
#define SET_TIME_FACE_NUM_SETTINGS (8)
|
||||
const char set_time_face_titles[SET_TIME_FACE_NUM_SETTINGS][3] = {"HR", "M1", "SE", "YR", "MO", "DA", "ZO", "DS"};
|
||||
#define SET_TIME_FACE_NUM_SETTINGS (7)
|
||||
const char set_time_face_titles[SET_TIME_FACE_NUM_SETTINGS][3] = {"HR", "M1", "SE", "YR", "MO", "DA", "ZO"};
|
||||
|
||||
static bool _quick_ticks_running;
|
||||
|
||||
@@ -59,16 +59,6 @@ static void _handle_alarm_button(movement_settings_t *settings, watch_date_time
|
||||
settings->bit.time_zone++;
|
||||
if (settings->bit.time_zone > 40) settings->bit.time_zone = 0;
|
||||
break;
|
||||
case 7: // daylight savings time
|
||||
if (settings->bit.dst_active) { // deactivate DST
|
||||
date_time.unit.hour = (date_time.unit.hour + 24 - 1) % 24;
|
||||
settings->bit.time_zone = movement_dst_inverse_jump_table[settings->bit.time_zone];
|
||||
} else { // activate DST
|
||||
date_time.unit.hour = (date_time.unit.hour + 1) % 24;
|
||||
settings->bit.time_zone = movement_dst_jump_table[settings->bit.time_zone];
|
||||
}
|
||||
settings->bit.dst_active = !settings->bit.dst_active;
|
||||
break;
|
||||
}
|
||||
if (date_time.unit.day > days_in_month(date_time.unit.month, date_time.unit.year + WATCH_RTC_REFERENCE_YEAR))
|
||||
date_time.unit.day = 1;
|
||||
@@ -155,7 +145,7 @@ bool set_time_face_loop(movement_event_t event, movement_settings_t *settings, v
|
||||
watch_clear_indicator(WATCH_INDICATOR_24H);
|
||||
watch_clear_indicator(WATCH_INDICATOR_PM);
|
||||
sprintf(buf, "%s %2d%02d%02d", set_time_face_titles[current_page], date_time.unit.year + 20, date_time.unit.month, date_time.unit.day);
|
||||
} else if (current_page < 7) { // zone
|
||||
} else {
|
||||
if (event.subsecond % 2) {
|
||||
watch_clear_colon();
|
||||
sprintf(buf, "%s ", set_time_face_titles[current_page]);
|
||||
@@ -163,10 +153,6 @@ bool set_time_face_loop(movement_event_t event, movement_settings_t *settings, v
|
||||
watch_set_colon();
|
||||
sprintf(buf, "%s %3d%02d ", set_time_face_titles[current_page], (int8_t) (movement_timezone_offsets[settings->bit.time_zone] / 60), (int8_t) (movement_timezone_offsets[settings->bit.time_zone] % 60) * (movement_timezone_offsets[settings->bit.time_zone] < 0 ? -1 : 1));
|
||||
}
|
||||
} else { // daylight savings
|
||||
watch_clear_colon();
|
||||
if (settings->bit.dst_active) sprintf(buf, "%s dsT y", set_time_face_titles[current_page]);
|
||||
else sprintf(buf, "%s dsT n", set_time_face_titles[current_page]);
|
||||
}
|
||||
|
||||
// blink up the parameter we're setting
|
||||
@@ -184,9 +170,6 @@ bool set_time_face_loop(movement_event_t event, movement_settings_t *settings, v
|
||||
case 5:
|
||||
buf[8] = buf[9] = ' ';
|
||||
break;
|
||||
case 7:
|
||||
buf[9] = ' ';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user