diff options
author | joeycastillo <joeycastillo@utexas.edu> | 2023-01-14 14:21:04 -0500 |
---|---|---|
committer | joeycastillo <joeycastillo@utexas.edu> | 2023-01-14 14:21:04 -0500 |
commit | 0ef80b62da5ada255ca1968e7437cb66606bd78d (patch) | |
tree | 1f721524b37c06f3e437605bf3bf27c443e3f7d5 /movement/movement.c | |
parent | 9ebea46300bd1bc4e3ba51b1c7915e3ba42c471a (diff) | |
download | Sensor-Watch-0ef80b62da5ada255ca1968e7437cb66606bd78d.tar.gz Sensor-Watch-0ef80b62da5ada255ca1968e7437cb66606bd78d.tar.bz2 Sensor-Watch-0ef80b62da5ada255ca1968e7437cb66606bd78d.zip |
add movement_default_loop_handler, test with default watch faces
Diffstat (limited to 'movement/movement.c')
-rw-r--r-- | movement/movement.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/movement/movement.c b/movement/movement.c index 6c5f93a0..05da1800 100644 --- a/movement/movement.c +++ b/movement/movement.c @@ -218,6 +218,26 @@ void movement_illuminate_led(void) { } } +bool movement_default_loop_handler(movement_event_t event, movement_settings_t *settings) { + (void)settings; + + switch (event.event_type) { + case EVENT_MODE_BUTTON_UP: + movement_move_to_next_face(); + break; + case EVENT_LIGHT_BUTTON_DOWN: + movement_illuminate_led(); + break; + case EVENT_MODE_LONG_PRESS: + movement_move_to_face(0); + break; + default: + break; + } + + return true; +} + void movement_move_to_face(uint8_t watch_face_index) { movement_state.watch_face_changed = true; movement_state.next_watch_face = watch_face_index; |