summaryrefslogtreecommitdiff
path: root/src/components/motion/MotionController.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/motion/MotionController.cpp')
-rw-r--r--src/components/motion/MotionController.cpp4
1 files changed, 2 insertions, 2 deletions
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;