add a manual dst toggle

Uses a simplistic set of jump tables to toggle daylight savings on and off.
This commit is contained in:
R. Alex Barbieri
2023-09-02 14:52:37 -05:00
parent 7fd51caa25
commit f3c28ede96
3 changed files with 125 additions and 7 deletions

View File

@@ -62,7 +62,8 @@ typedef union {
bool clock_mode_24h : 1; // indicates whether clock should use 12 or 24 hour mode.
bool use_imperial_units : 1; // indicates whether to use metric units (the default) or imperial.
bool alarm_enabled : 1; // indicates whether there is at least one alarm enabled.
uint8_t reserved : 6; // room for more preferences if needed.
bool dst_active : 1; // indicates whether daylight savings time is active
uint8_t reserved : 5; // room for more preferences if needed.
} bit;
uint32_t reg;
} movement_settings_t;
@@ -128,6 +129,8 @@ typedef struct {
} movement_event_t;
extern const int16_t movement_timezone_offsets[];
extern const uint8_t movement_dst_jump_table[];
extern const uint8_t movement_dst_inverse_jump_table[];
extern const char movement_valid_position_0_chars[];
extern const char movement_valid_position_1_chars[];