bugfix: maintain accelerometer background sampling rate after wake from sleep

This commit is contained in:
Joey Castillo 2025-07-03 17:14:08 -04:00
parent 49c31317c8
commit 37a8a92f58

View File

@ -784,11 +784,12 @@ void app_setup(void) {
// Enable the interrupts... // Enable the interrupts...
lis2dw_enable_interrupts(); lis2dw_enable_interrupts();
// ...and power down the accelerometer to save energy. This means the interrupts we just configured won't fire. // At first boot, this next line sets the accelerometer's sampling rate to 0, which is LIS2DW_DATA_RATE_POWERDOWN.
// This means the interrupts we just configured won't fire.
// Tap detection will ramp up sesing and make use of the A3 interrupt. // Tap detection will ramp up sesing and make use of the A3 interrupt.
// If a watch face wants to check in on the A4 pin, it can call movement_set_accelerometer_background_rate // If a watch face wants to check in on the A4 interrupt pin for motion status, it can call
lis2dw_set_data_rate(LIS2DW_DATA_RATE_POWERDOWN); // movement_set_accelerometer_background_rate with another rate like LIS2DW_DATA_RATE_LOWEST or LIS2DW_DATA_RATE_25_HZ.
movement_state.accelerometer_background_rate = LIS2DW_DATA_RATE_POWERDOWN; lis2dw_set_data_rate(movement_state.accelerometer_background_rate);
} }
#endif #endif