]> git.earman.xyz Git - sensor-watch.git/commitdiff
Minor improvement to movement_force_led_on logic
authorAlessandro Genova <ales.genova@gmail.com>
Sat, 16 Aug 2025 02:50:10 +0000 (22:50 -0400)
committerAlessandro Genova <ales.genova@gmail.com>
Sat, 3 Jan 2026 01:07:56 +0000 (20:07 -0500)
movement.c

index aa90f034623a44798cdcd934551dcc04e9a949e4..f52050e054d4b14285c6c3452b1dbdb246577602 100644 (file)
@@ -400,8 +400,8 @@ void movement_force_led_on(uint8_t red, uint8_t green, uint8_t blue) {
     // this is hacky, we need a way for watch faces to set an arbitrary color and prevent Movement from turning it right back off.
     movement_state.light_on = true;
     watch_set_led_color_rgb(red, green, blue);
-    rtc_counter_t counter = watch_rtc_get_counter();
-    watch_rtc_register_comp_callback_no_schedule(cb_led_timeout_interrupt, counter + 32767, LED_TIMEOUT);
+    // The led will stay on until movement_force_led_off is called, so disable the led timeout in case we were in the middle of it.
+    watch_rtc_disable_comp_callback_no_schedule(LED_TIMEOUT);
     movement_volatile_state.schedule_next_comp = true;
 }