From 9d47eb9a119f4dde78063316f6ff0a1668b4c1e0 Mon Sep 17 00:00:00 2001 From: joeycastillo Date: Sun, 15 Jan 2023 09:28:41 -0600 Subject: handle switch to secondary face in default handler --- movement/movement.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/movement/movement.c b/movement/movement.c index 05da1800..1a646e25 100644 --- a/movement/movement.c +++ b/movement/movement.c @@ -229,7 +229,11 @@ bool movement_default_loop_handler(movement_event_t event, movement_settings_t * movement_illuminate_led(); break; case EVENT_MODE_LONG_PRESS: - movement_move_to_face(0); + if (MOVEMENT_SECONDARY_FACE_INDEX && movement_state.current_watch_face == 0) { + movement_move_to_face(MOVEMENT_SECONDARY_FACE_INDEX); + } else { + movement_move_to_face(0); + } break; default: break; @@ -468,20 +472,6 @@ bool app_loop(void) { if (event.event_type) { event.subsecond = movement_state.subsecond; can_sleep = watch_faces[movement_state.current_watch_face].loop(event, &movement_state.settings, watch_face_contexts[movement_state.current_watch_face]); - - // Long-pressing MODE brings one back to the first face, provided that the watch face hasn't decided to send them elsewhere - // (and we're not currently on the first face). If we're currently on the first face, a long press - // of MODE sends us to the secondary faces (if defined). - // Note that it's the face's responsibility to provide some way to get to the next face, so if EVENT_MODE_BUTTON_* is - // used for face functionality EVENT_MODE_LONG_PRESS should probably be handled and next_face() triggered in the face - // (which would effectively disable the normal 'long press to face 0' behaviour). - if (event.event_type == EVENT_MODE_LONG_PRESS - && !movement_state.watch_face_changed) { - if (MOVEMENT_SECONDARY_FACE_INDEX && movement_state.current_watch_face == 0) { - movement_move_to_face(MOVEMENT_SECONDARY_FACE_INDEX); - } - } - event.event_type = EVENT_NONE; } // if we have timed out of our timeout countdown, give the app a hint that they can resign. -- cgit v1.2.3