diff options
author | Joey Castillo <jose.castillo@gmail.com> | 2021-10-18 12:31:44 -0400 |
---|---|---|
committer | Joey Castillo <jose.castillo@gmail.com> | 2021-10-18 13:55:30 -0400 |
commit | 1db9e18b927a45b6f93279ee6b9929679f0a9cc5 (patch) | |
tree | 6606a96bb50a3fda579bada594dad8e21b7619b9 | |
parent | 93624f0b692648eac415a3df5689de6dee06c2db (diff) | |
download | Sensor-Watch-1db9e18b927a45b6f93279ee6b9929679f0a9cc5.tar.gz Sensor-Watch-1db9e18b927a45b6f93279ee6b9929679f0a9cc5.tar.bz2 Sensor-Watch-1db9e18b927a45b6f93279ee6b9929679f0a9cc5.zip |
pulsometer: rearrange switch for clarity
-rw-r--r-- | movement/watch_faces/complications/pulsometer_face.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/movement/watch_faces/complications/pulsometer_face.c b/movement/watch_faces/complications/pulsometer_face.c index e54b4551..abe002fb 100644 --- a/movement/watch_faces/complications/pulsometer_face.c +++ b/movement/watch_faces/complications/pulsometer_face.c @@ -21,6 +21,23 @@ bool pulsometer_face_loop(movement_event_t event, movement_settings_t *settings, pulsometer_state_t *pulsometer_state = (pulsometer_state_t *)context; char buf[14]; switch (event.event_type) { + case EVENT_MODE_BUTTON_UP: + movement_move_to_next_face(); + break; + case EVENT_LIGHT_BUTTON_UP: + movement_illuminate_led(); + break; + case EVENT_ALARM_BUTTON_DOWN: + pulsometer_state->measuring = true; + pulsometer_state->pulse = 0xFFFF; + pulsometer_state->ticks = 0; + movement_request_tick_frequency(PULSOMETER_FACE_FREQUENCY); + break; + case EVENT_ALARM_BUTTON_UP: + case EVENT_ALARM_LONG_PRESS: + pulsometer_state->measuring = false; + movement_request_tick_frequency(1); + break; case EVENT_TICK: if (pulsometer_state->pulse == 0 && !pulsometer_state->measuring) { switch (pulsometer_state->ticks % 5) { @@ -55,23 +72,6 @@ bool pulsometer_face_loop(movement_event_t event, movement_settings_t *settings, } if (pulsometer_state->measuring) pulsometer_state->ticks++; } - return false; - case EVENT_MODE_BUTTON_UP: - movement_move_to_next_face(); - return false; - case EVENT_LIGHT_BUTTON_UP: - movement_illuminate_led(); - break; - case EVENT_ALARM_BUTTON_DOWN: - pulsometer_state->ticks = 0; - pulsometer_state->pulse = 0xFFFF; - pulsometer_state->measuring = true; - movement_request_tick_frequency(PULSOMETER_FACE_FREQUENCY); - break; - case EVENT_ALARM_BUTTON_UP: - case EVENT_ALARM_LONG_PRESS: - pulsometer_state->measuring = false; - movement_request_tick_frequency(1); break; case EVENT_TIMEOUT: movement_move_to_face(0); |