make the watch-face a global in movement.c, actually

This commit is contained in:
Alex Maestas 2023-12-17 03:23:26 +00:00
parent 8eae6eabd6
commit 0e801ed505

View File

@ -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 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}; const int16_t movement_timeout_inactivity_deadlines[4] = {60, 120, 300, 1800};
movement_event_t event; movement_event_t event;
const watch_face_t *wf;
const int16_t movement_timezone_offsets[] = { const int16_t movement_timezone_offsets[] = {
0, // 0 : 0:00:00 (UTC) 0, // 0 : 0:00:00 (UTC)
@ -414,7 +415,7 @@ void app_setup(void) {
watch_faces[i].setup(&movement_state.settings, i, &watch_face_contexts[i]); 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.subsecond = 0;
event.event_type = EVENT_ACTIVATE; event.event_type = EVENT_ACTIVATE;
} }
@ -434,7 +435,7 @@ static void _sleep_mode_app_loop(void) {
if (movement_state.needs_background_tasks_handled) _movement_handle_background_tasks(); if (movement_state.needs_background_tasks_handled) _movement_handle_background_tasks();
event.event_type = EVENT_LOW_ENERGY_UPDATE; 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 we need to wake immediately, do it!
if (movement_state.needs_wake) return; if (movement_state.needs_wake) return;
@ -444,7 +445,7 @@ static void _sleep_mode_app_loop(void) {
} }
bool 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.watch_face_changed) {
if (movement_state.settings.bit.button_should_sound) { if (movement_state.settings.bit.button_should_sound) {
// low note for nonzero case, high note for return to watch_face 0 // low note for nonzero case, high note for return to watch_face 0