summaryrefslogtreecommitdiff
path: root/src/components/motion/MotionController.cpp
diff options
context:
space:
mode:
authorMichele Bini <michele.bini@gmail.com>2022-03-27 06:57:01 (GMT)
committerMichele Bini <michele.bini@gmail.com>2022-03-27 06:57:01 (GMT)
commit8413e62eeab686fad4f3d280e4732571372088e3 (patch)
tree261000c41a03f35adbbf700fe472554b38c61de8 /src/components/motion/MotionController.cpp
parentce7fd962caf64fa0037d1b80baa48deb88839010 (diff)
Sans shakewake and leftover modifications: Size: 228360
Diffstat (limited to 'src/components/motion/MotionController.cpp')
-rw-r--r--src/components/motion/MotionController.cpp22
1 files changed, 0 insertions, 22 deletions
diff --git a/src/components/motion/MotionController.cpp b/src/components/motion/MotionController.cpp
index aa2f3ee..0404e3f 100644
--- a/src/components/motion/MotionController.cpp
+++ b/src/components/motion/MotionController.cpp
@@ -31,28 +31,6 @@ bool MotionController::Should_RaiseWake(bool isSleeping) {
return false;
}
-bool MotionController::Should_ShakeWake(uint16_t thresh) {
- bool wake = false;
- auto diff = xTaskGetTickCount() - lastShakeTime;
- lastShakeTime = xTaskGetTickCount();
- /* Currently Polling at 10hz, If this ever goes faster scalar and EMA might need adjusting */
- int32_t speed = std::abs(z + (y / 2) + (x / 4) - lastYForShake - lastZForShake) / diff * 100;
- //(.2 * speed) + ((1 - .2) * accumulatedspeed);
- // implemented without floats as .25Alpha
- accumulatedspeed = (speed / 5) + ((accumulatedspeed / 5) * 4);
-
- if (accumulatedspeed > thresh) {
- wake = true;
- }
- lastXForShake = x / 4;
- lastYForShake = y / 2;
- lastZForShake = z;
- return wake;
-}
-int32_t MotionController::currentShakeSpeed() {
- return accumulatedspeed;
-}
-
void MotionController::IsSensorOk(bool isOk) {
isSensorOk = isOk;
}