diff options
| author | joeycastillo <joeycastillo@utexas.edu> | 2023-01-25 09:26:31 -0600 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-25 09:26:31 -0600 | 
| commit | 4412b5d08f90084a8e677bea4792851e6d82bdf3 (patch) | |
| tree | c1298f3ea924d8102b33bd796373209dad8be63b /movement/movement.c | |
| parent | 2b22ecc8e43cc21c56d82ee3f89f32dd7b6b8e4a (diff) | |
| parent | 3303060c59e1591bd2c6bb7cfc5b21e550728d6d (diff) | |
| download | Sensor-Watch-default-handler.tar.gz Sensor-Watch-default-handler.tar.bz2 Sensor-Watch-default-handler.zip | |
Merge branch 'main' into default-handlerdefault-handler
Diffstat (limited to 'movement/movement.c')
| -rw-r--r-- | movement/movement.c | 6 | 
1 files changed, 5 insertions, 1 deletions
| diff --git a/movement/movement.c b/movement/movement.c index 1a646e25..1bb4a3af 100644 --- a/movement/movement.c +++ b/movement/movement.c @@ -142,6 +142,7 @@ static inline void _movement_enable_fast_tick_if_needed(void) {      if (!movement_state.fast_tick_enabled) {          movement_state.fast_ticks = 0;          watch_rtc_register_periodic_callback(cb_fast_tick, 128); +        movement_state.fast_tick_enabled = true;      }  } @@ -615,7 +616,10 @@ void cb_fast_tick(void) {              event.event_type = EVENT_ALARM_LONG_PRESS;      // this is just a fail-safe; fast tick should be disabled as soon as the button is up, the LED times out, and/or the alarm finishes.      // but if for whatever reason it isn't, this forces the fast tick off after 20 seconds. -    if (movement_state.fast_ticks >= 128 * 20) watch_rtc_disable_periodic_callback(128); +    if (movement_state.fast_ticks >= 128 * 20) { +        watch_rtc_disable_periodic_callback(128); +        movement_state.fast_tick_enabled = false; +    }  }  void cb_tick(void) { | 
