From 76e79df375aca1b34a53eedc38bce7a3cda0a8a7 Mon Sep 17 00:00:00 2001 From: Finlay Davidson Date: Sun, 5 Mar 2023 15:19:52 +0100 Subject: shakewake: Switch to more generic timekeeping Could be used for other motion-based algorithms in the future. --- src/components/motion/MotionController.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/components/motion/MotionController.h') diff --git a/src/components/motion/MotionController.h b/src/components/motion/MotionController.h index 8fb03d81..126504a3 100644 --- a/src/components/motion/MotionController.h +++ b/src/components/motion/MotionController.h @@ -2,6 +2,8 @@ #include +#include + #include "drivers/Bma421.h" #include "components/ble/MotionService.h" @@ -65,19 +67,20 @@ namespace Pinetime { uint32_t nbSteps; uint32_t currentTripSteps = 0; + TickType_t lastTime = 0; + TickType_t time = 0; + int16_t x; int16_t lastYForWakeUp = 0; int16_t lastY = 0; int16_t y; int16_t lastZ = 0; int16_t z; + int32_t accumulatedSpeed = 0; bool isSensorOk = false; DeviceTypes deviceType = DeviceTypes::Unknown; Pinetime::Controllers::MotionService* service = nullptr; - - int32_t accumulatedSpeed = 0; - uint32_t lastShakeTime = 0; }; } } -- cgit v1.2.3-70-g09d2