diff options
author | Joey Castillo <joeycastillo@utexas.edu> | 2022-04-06 14:56:18 -0400 |
---|---|---|
committer | Joey Castillo <joeycastillo@utexas.edu> | 2022-04-06 14:56:18 -0400 |
commit | 4e89d70f999c8766a9cebe0700e1d6ea9d7bbfcf (patch) | |
tree | 2baca9564649801aef3be5dc4600284900d528d6 /movement/watch_faces/complication/countdown_face.c | |
parent | 2cba47996ed08c83b7c9b2ba521b68fb8a62f666 (diff) | |
parent | 1ec1f2e4207405d55c34c936e2c458cb4a7e8806 (diff) | |
download | Sensor-Watch-4e89d70f999c8766a9cebe0700e1d6ea9d7bbfcf.tar.gz Sensor-Watch-4e89d70f999c8766a9cebe0700e1d6ea9d7bbfcf.tar.bz2 Sensor-Watch-4e89d70f999c8766a9cebe0700e1d6ea9d7bbfcf.zip |
Merge branch 'main' of github.com:joeycastillo/Sensor-Watch into mars-clock
Diffstat (limited to 'movement/watch_faces/complication/countdown_face.c')
-rw-r--r-- | movement/watch_faces/complication/countdown_face.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/movement/watch_faces/complication/countdown_face.c b/movement/watch_faces/complication/countdown_face.c index a910e96c..81836f37 100644 --- a/movement/watch_faces/complication/countdown_face.c +++ b/movement/watch_faces/complication/countdown_face.c @@ -35,14 +35,6 @@ #define DEFAULT_MINUTES 3 -static uint32_t offset_date_time(uint32_t now, int8_t hours, int8_t minutes, int8_t seconds) { - uint32_t new = now; - new += hours * 60 * 60; - new += minutes * 60; - new += seconds; - return new; -} - static inline int32_t get_tz_offset(movement_settings_t *settings) { return movement_timezone_offsets[settings->bit.time_zone] * 60; } @@ -52,7 +44,7 @@ static void start(countdown_state_t *state, movement_settings_t *settings) { state->mode = cd_running; state->now_ts = watch_utility_date_time_to_unix_time(now, get_tz_offset(settings)); - state->target_ts = offset_date_time(state->now_ts, 0, state->minutes, state->seconds); + state->target_ts = watch_utility_offset_timestamp(state->now_ts, 0, state->minutes, state->seconds); watch_date_time target_dt = watch_utility_date_time_from_unix_time(state->target_ts, get_tz_offset(settings)); movement_schedule_background_task(target_dt); watch_set_indicator(WATCH_INDICATOR_BELL); |