]> git.earman.xyz Git - sensor-watch.git/commitdiff
accelerometer status face: bug fixes
authorJoey Castillo <joeycastillo@utexas.edu>
Thu, 12 Jun 2025 03:06:40 +0000 (23:06 -0400)
committerJoey Castillo <joeycastillo@utexas.edu>
Thu, 12 Jun 2025 03:06:40 +0000 (23:06 -0400)
watch-faces/sensor/accelerometer_status_face.c
watch-faces/sensor/accelerometer_status_face.h

index df44330047af2500634a1820668272b6f2ac840c..8aa07361cae941aa33d711370ef243361868f7e6 100644 (file)
@@ -54,13 +54,6 @@ void accelerometer_status_face_setup(uint8_t watch_face_index, void ** context_p
 void accelerometer_status_face_activate(void *context) {
     accel_interrupt_count_state_t *state = (accel_interrupt_count_state_t *)context;
 
-    // get the current data rate from Movement
-    state->old_rate = movement_get_accelerometer_background_rate();
-    if (state->old_rate == LIS2DW_DATA_RATE_POWERDOWN) {
-        // if accelerometer was powered down, power it up at the lowest possible rate
-        movement_set_accelerometer_background_rate(LIS2DW_DATA_RATE_LOWEST);
-    }
-
     // never in settings mode at the start
     state->is_setting = false;
 
@@ -96,6 +89,7 @@ bool accelerometer_status_face_loop(movement_event_t event, void *context) {
             case EVENT_ALARM_BUTTON_UP:
                 lis2dw_configure_wakeup_threshold(state->new_threshold);
                 state->threshold = state->new_threshold;
+                watch_clear_decimal_if_available();
                 state->is_setting = false;
                 break;
             case EVENT_TIMEOUT:
@@ -133,9 +127,5 @@ bool accelerometer_status_face_loop(movement_event_t event, void *context) {
 }
 
 void accelerometer_status_face_resign(void *context) {
-    accel_interrupt_count_state_t *state = (accel_interrupt_count_state_t *)context;
-
-    // restore old data rate. This only does something if old_rate was POWERDOWN.
-    // If the old rate was anything other than POWERDOWN, we didn't change anything and this will be a no-op.
-    movement_set_accelerometer_background_rate(state->old_rate);
+    (void)context;
 }
index 2e15c510797dfe49531efbcb598cb3afe0aca805..2b152d5f37cad845d704a8f7d2e8a227293f0453 100644 (file)
@@ -38,7 +38,6 @@
 typedef struct {
     uint8_t new_threshold;
     uint8_t threshold;
-    lis2dw_data_rate_t old_rate;
     bool is_setting;
 } accel_interrupt_count_state_t;