mirror of
https://github.com/firewalkwithm3/Sensor-Watch.git
synced 2024-11-22 19:20:30 +08:00
Merge PR #394 - keep LED lit while buttons held
Keeps the LED turned on while the user is interacting with the watch. Reviewed-by: Matheus Afonso Martins Moreira <matheus@matheusmoreira.com> GitHub-Pull-Request: https://github.com/joeycastillo/Sensor-Watch/pull/394
This commit is contained in:
commit
99586f8442
|
@ -612,6 +612,17 @@ bool app_loop(void) {
|
||||||
event.subsecond = movement_state.subsecond;
|
event.subsecond = movement_state.subsecond;
|
||||||
// the first trip through the loop overrides the can_sleep state
|
// the first trip through the loop overrides the can_sleep state
|
||||||
can_sleep = wf->loop(event, &movement_state.settings, watch_face_contexts[movement_state.current_face_idx]);
|
can_sleep = wf->loop(event, &movement_state.settings, watch_face_contexts[movement_state.current_face_idx]);
|
||||||
|
|
||||||
|
// Keep light on if user is still interacting with the watch.
|
||||||
|
if (movement_state.light_ticks > 0) {
|
||||||
|
switch (event.event_type) {
|
||||||
|
case EVENT_LIGHT_BUTTON_DOWN:
|
||||||
|
case EVENT_MODE_BUTTON_DOWN:
|
||||||
|
case EVENT_ALARM_BUTTON_DOWN:
|
||||||
|
movement_illuminate_led();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
event.event_type = EVENT_NONE;
|
event.event_type = EVENT_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,6 +89,7 @@ void main_loop_sleep(uint32_t ms) {
|
||||||
main_loop_set_sleeping(true);
|
main_loop_set_sleeping(true);
|
||||||
emscripten_sleep(ms);
|
emscripten_sleep(ms);
|
||||||
main_loop_set_sleeping(false);
|
main_loop_set_sleeping(false);
|
||||||
|
animation_frame_id = ANIMATION_FRAME_ID_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool main_loop_is_sleeping(void) {
|
bool main_loop_is_sleeping(void) {
|
||||||
|
|
Loading…
Reference in a new issue