diff --git a/src/components/motion/MotionController.cpp b/src/components/motion/MotionController.cpp index 523f02ebdd..6870d8cb7f 100644 --- a/src/components/motion/MotionController.cpp +++ b/src/components/motion/MotionController.cpp @@ -17,17 +17,16 @@ void MotionController::Update(int16_t x, int16_t y, int16_t z, uint32_t nbSteps) this->nbSteps = nbSteps; } -bool MotionController::ShouldWakeUp(bool isSleeping) { +bool MotionController::ShouldWakeUp() { bool ret = false; if (x >= -384 && x <= 384 && z <= 0 && - y <= lastYForWakeUp - 192 && - isSleeping) { + y <= lastYForWakeUp - 128) { ret = true; } - lastYForWakeUp = (y < 0) ? y : 0; + lastYForWakeUp = (y < 128) ? y : 128; return ret; } diff --git a/src/components/motion/MotionController.h b/src/components/motion/MotionController.h index c72d8a4a0f..7fa02664b0 100644 --- a/src/components/motion/MotionController.h +++ b/src/components/motion/MotionController.h @@ -28,7 +28,7 @@ namespace Pinetime { uint32_t NbSteps() const { return nbSteps; } - bool ShouldWakeUp(bool isSleeping); + bool ShouldWakeUp(); void IsSensorOk(bool isOk); bool IsSensorOk() const { @@ -53,4 +53,4 @@ namespace Pinetime { Pinetime::Controllers::MotionService* service = nullptr; }; } -} \ No newline at end of file +} diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index a95d479dec..0c694c25bb 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -470,7 +470,7 @@ void SystemTask::UpdateMotion() { motionController.IsSensorOk(motionSensor.IsOk()); motionController.Update(motionValues.x, motionValues.y, motionValues.z, motionValues.steps); - if (motionController.ShouldWakeUp(isSleeping)) { + if (motionController.ShouldWakeUp() && isSleeping) { GoToRunning(); } }