accelerometer: keep threshold across sleeps by tracking it in movement

This commit is contained in:
Joey Castillo
2025-06-25 17:22:17 -04:00
parent 7eef8d18e5
commit b1c67bea94
3 changed files with 28 additions and 3 deletions

View File

@@ -61,7 +61,7 @@ void accelerometer_status_face_activate(void *context) {
movement_request_tick_frequency(4);
// fetch current threshold from accelerometer
state->threshold = lis2dw_get_wakeup_threshold();
state->threshold = movement_get_accelerometer_motion_threshold();
}
bool accelerometer_status_face_loop(movement_event_t event, void *context) {
@@ -87,7 +87,7 @@ bool accelerometer_status_face_loop(movement_event_t event, void *context) {
}
break;
case EVENT_ALARM_BUTTON_UP:
lis2dw_configure_wakeup_threshold(state->new_threshold);
movement_set_accelerometer_motion_threshold(state->new_threshold);
state->threshold = state->new_threshold;
watch_clear_decimal_if_available();
state->is_setting = false;