summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjoeycastillo <joeycastillo@utexas.edu>2023-01-15 09:28:41 -0600
committerjoeycastillo <joeycastillo@utexas.edu>2023-01-15 09:28:41 -0600
commit9d47eb9a119f4dde78063316f6ff0a1668b4c1e0 (patch)
tree691a79b826b930248a2196770810ce7b03c923be
parent0ef80b62da5ada255ca1968e7437cb66606bd78d (diff)
downloadSensor-Watch-9d47eb9a119f4dde78063316f6ff0a1668b4c1e0.tar.gz
Sensor-Watch-9d47eb9a119f4dde78063316f6ff0a1668b4c1e0.tar.bz2
Sensor-Watch-9d47eb9a119f4dde78063316f6ff0a1668b4c1e0.zip
handle switch to secondary face in default handler
-rw-r--r--movement/movement.c20
1 files 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.