]> git.earman.xyz Git - sensor-watch.git/commitdiff
accel: lower wake threshold to smallest possible value
authorjoeycastillo <joeycastillo@utexas.edu>
Mon, 18 Nov 2024 23:45:44 +0000 (18:45 -0500)
committerjoeycastillo <joeycastillo@utexas.edu>
Mon, 18 Nov 2024 23:45:44 +0000 (18:45 -0500)
movement.c
watch-faces/demo/accel_interrupt_count_face.c

index 80693673e8a52e73050f1c4681b561ad5208c399..bfc4f1110557ab7ccafeb0ecc09cbe14d3546eec 100644 (file)
@@ -641,12 +641,12 @@ void app_setup(void) {
             lis2dw_enable_stationary_motion_detection();    // stationary/motion detection mode keeps the data rate at 1.6 Hz even in sleep
             lis2dw_set_range(LIS2DW_RANGE_2_G);             // Application note AN5038 recommends 2g range
             lis2dw_enable_sleep();                          // allow acceleromter to sleep and wake on activity
-            lis2dw_configure_wakeup_threshold(24);          // g threshold to wake up: (2 * FS / 64) where FS is "full scale" of ±2g.
+            lis2dw_configure_wakeup_threshold(1);           // g threshold to wake up: (2 * FS / 64) where FS is "full scale" of ±2g.
             lis2dw_configure_6d_threshold(3);               // 0-3 is 80, 70, 60, or 50 degrees. 50 is least precise, hopefully most sensitive?
 
             // set up interrupts:
             // INT1 is on A4 which can wake from deep sleep. Wake on 6D orientation change.
-            lis2dw_configure_int1(LIS2DW_CTRL4_INT1_6D | LIS2DW_CTRL4_INT1_WU | LIS2DW_CTRL4_INT1_TAP | LIS2DW_CTRL4_INT1_SINGLE_TAP);
+            lis2dw_configure_int1(LIS2DW_CTRL4_INT1_6D);
             watch_register_extwake_callback(HAL_GPIO_A4_pin(), cb_motion_interrupt_1, true);
 
             // configure the accelerometer to output the sleep state on INT2.
index fae99b9fc67e4be5cdefefef4413893956d3d3f6..194a5f7e5b0c629cd67f0c2560e12cf5a4891e3b 100644 (file)
@@ -59,7 +59,7 @@ void accel_interrupt_count_face_setup(uint8_t watch_face_index, void ** context_
         memset(*context_ptr, 0, sizeof(accel_interrupt_count_state_t));
         accel_interrupt_count_state_t *state = (accel_interrupt_count_state_t *)*context_ptr;
         /// TODO: hook up to movement methods for tracking threshold
-        state->threshold = 24;
+        state->threshold = 1;
     }
 }