summaryrefslogtreecommitdiffstats
path: root/movement/movement.c
diff options
context:
space:
mode:
Diffstat (limited to 'movement/movement.c')
-rw-r--r--movement/movement.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/movement/movement.c b/movement/movement.c
index 3997b4a4..4291a599 100644
--- a/movement/movement.c
+++ b/movement/movement.c
@@ -167,7 +167,7 @@ static void _movement_handle_background_tasks(void) {
}
static void _movement_handle_scheduled_tasks(void) {
- watch_date_time date_time = watch_rtc_get_date_time();
+ watch_date_time date_time = movement_get_date_time();
uint8_t num_active_tasks = 0;
for(uint8_t i = 0; i < MOVEMENT_NUM_FACES; i++) {
@@ -193,6 +193,10 @@ static void _movement_handle_scheduled_tasks(void) {
}
}
+watch_date_time movement_get_date_time(void) {
+ return watch_rtc_get_date_time();
+}
+
void movement_request_tick_frequency(uint8_t freq) {
// Movement uses the 128 Hz tick internally
if (freq == 128) return;
@@ -242,7 +246,7 @@ void movement_cancel_background_task(void) {
}
void movement_schedule_background_task_for_face(uint8_t watch_face_index, watch_date_time date_time) {
- watch_date_time now = watch_rtc_get_date_time();
+ watch_date_time now = movement_get_date_time();
if (date_time.reg > now.reg) {
movement_state.has_scheduled_background_task = true;
scheduled_tasks[watch_face_index].reg = date_time.reg;
@@ -612,7 +616,7 @@ void cb_fast_tick(void) {
void cb_tick(void) {
event.event_type = EVENT_TICK;
- watch_date_time date_time = watch_rtc_get_date_time();
+ watch_date_time date_time = movement_get_date_time();
if (date_time.unit.second != movement_state.last_second) {
// TODO: can we consolidate these two ticks?
if (movement_state.settings.bit.le_interval && movement_state.le_mode_ticks > 0) movement_state.le_mode_ticks--;