From 2b1eae7f597ea6c210b4c15a73ab5ba116fc5d2a Mon Sep 17 00:00:00 2001 From: Finlay Davidson Date: Sat, 20 May 2023 01:27:00 +0200 Subject: raisewake: Improve raise to wake algorithm This new algorithm calculates the number of degrees that the wrist has rolled, and checks if that is above a threshold. First it checks if the wrist is still enough for the acceleration values to be considered mostly from gravity. It does this by calculating the mean over the past 2 SystemTask loops, and checking that the variance from that mean is below a threshold. Then it calculates the angle the wrist is being held at, and calculates the difference from the angle some time ago. If this difference is above the threshold, it wakes the watch. --- src/systemtask/SystemTask.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/systemtask') diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index b199d53f..4719bb50 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -430,7 +430,7 @@ void SystemTask::UpdateMotion() { if (settingsController.GetNotificationStatus() != Controllers::Settings::Notification::Sleep) { if ((settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::RaiseWrist) && - motionController.ShouldRaiseWake(state == SystemTaskState::Sleeping)) || + motionController.ShouldRaiseWake()) || (settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::Shake) && motionController.ShouldShakeWake(settingsController.GetShakeThreshold()))) { GoToRunning(); -- cgit v1.2.3-70-g09d2