From 3ebf002f9db75513d036c0eaa0863e75882b3a40 Mon Sep 17 00:00:00 2001 From: Tim Keller Date: Mon, 27 Sep 2021 02:52:02 +0000 Subject: Add start of settings app for senstivity. really just debugging. I want to make it more configurable then high med low. Position of setting needs a new location...dynamicly adding it currently at the end. Which honestly im fine with. --- src/components/motion/MotionController.cpp | 4 ++-- src/components/motion/MotionController.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/components/motion') diff --git a/src/components/motion/MotionController.cpp b/src/components/motion/MotionController.cpp index 58a7f672..615ad26c 100644 --- a/src/components/motion/MotionController.cpp +++ b/src/components/motion/MotionController.cpp @@ -45,12 +45,12 @@ bool MotionController::Should_RaiseWake(bool isSleeping) { return false; } -bool MotionController::Should_ShakeWake() { +bool MotionController::Should_ShakeWake(uint16_t thresh) { bool wake = false; auto diff = xTaskGetTickCount() - lastShakeTime; lastShakeTime = xTaskGetTickCount(); int32_t speed = std::abs(y + z - lastYForShake - lastZForShake) / diff * 10; - if (speed > 150) { // TODO move threshold to a setting + if (speed > thresh) { wake = true; } lastXForShake = x; diff --git a/src/components/motion/MotionController.h b/src/components/motion/MotionController.h index bd925cc7..28f7d3a7 100644 --- a/src/components/motion/MotionController.h +++ b/src/components/motion/MotionController.h @@ -35,7 +35,8 @@ namespace Pinetime { uint32_t GetTripSteps() const { return currentTripSteps; } - bool Should_ShakeWake(); + + bool Should_ShakeWake(uint16_t thresh); bool Should_RaiseWake(bool isSleeping); void IsSensorOk(bool isOk); -- cgit v1.2.3-70-g09d2