Skip to content

Commit

Permalink
make the watch-face a global in movement.c, actually
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Maestas committed Dec 17, 2023
1 parent 8eae6ea commit 0e801ed
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions movement/movement.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ watch_date_time scheduled_tasks[MOVEMENT_NUM_FACES];
const int32_t movement_le_inactivity_deadlines[8] = {INT_MAX, 3600, 7200, 21600, 43200, 86400, 172800, 604800};
const int16_t movement_timeout_inactivity_deadlines[4] = {60, 120, 300, 1800};
movement_event_t event;
const watch_face_t *wf;

const int16_t movement_timezone_offsets[] = {
0, // 0 : 0:00:00 (UTC)
Expand Down Expand Up @@ -414,7 +415,7 @@ void app_setup(void) {
watch_faces[i].setup(&movement_state.settings, i, &watch_face_contexts[i]);
}

watch_faces[movement_state.current_face_idx].activate(&movement_state.settings, watch_face_contexts[movement_state.current_face_idx]);
wf->activate(&movement_state.settings, watch_face_contexts[movement_state.current_face_idx]);
event.subsecond = 0;
event.event_type = EVENT_ACTIVATE;
}
Expand All @@ -434,7 +435,7 @@ static void _sleep_mode_app_loop(void) {
if (movement_state.needs_background_tasks_handled) _movement_handle_background_tasks();

event.event_type = EVENT_LOW_ENERGY_UPDATE;
watch_faces[movement_state.current_face_idx].loop(event, &movement_state.settings, watch_face_contexts[movement_state.current_face_idx]);
wf->loop(event, &movement_state.settings, watch_face_contexts[movement_state.current_face_idx]);

// if we need to wake immediately, do it!
if (movement_state.needs_wake) return;
Expand All @@ -444,7 +445,7 @@ static void _sleep_mode_app_loop(void) {
}

bool app_loop(void) {
const watch_face_t *wf = &watch_faces[movement_state.current_face_idx];
wf = &watch_faces[movement_state.current_face_idx];
if (movement_state.watch_face_changed) {
if (movement_state.settings.bit.button_should_sound) {
// low note for nonzero case, high note for return to watch_face 0
Expand Down

0 comments on commit 0e801ed

Please sign in to comment.