aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/motion/MotionController.h
diff options
context:
space:
mode:
authorFinlay Davidson <finlay.davidson@coderclass.nl>2023-03-05 15:19:52 +0100
committerRiku Isokoski <riksu9000@gmail.com>2023-03-09 10:17:03 +0200
commit76e79df375aca1b34a53eedc38bce7a3cda0a8a7 (patch)
tree19251ce7d37f3cf5ba1a906b6da051ff60be0d58 /src/components/motion/MotionController.h
parenta43463762c7983a27d2a020a05a77dff5beb30c9 (diff)
shakewake: Switch to more generic timekeeping
Could be used for other motion-based algorithms in the future.
Diffstat (limited to 'src/components/motion/MotionController.h')
-rw-r--r--src/components/motion/MotionController.h9
1 files changed, 6 insertions, 3 deletions
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 <cstdint>
+#include <FreeRTOS.h>
+
#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;
};
}
}