From d270275bd2d1044cb4db9af8efc1d766617b07a1 Mon Sep 17 00:00:00 2001 From: Tim Keller Date: Mon, 27 Sep 2021 01:20:44 +0000 Subject: Added Shake to wake --- src/components/motion/MotionController.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/components/motion/MotionController.h') diff --git a/src/components/motion/MotionController.h b/src/components/motion/MotionController.h index 3eac7176..f9c285e8 100644 --- a/src/components/motion/MotionController.h +++ b/src/components/motion/MotionController.h @@ -13,6 +13,10 @@ namespace Pinetime { BMA421, BMA425, }; + enum class WakeUpMode : uint8_t { + RaiseWrist = 0, + Shake, + }; void Update(int16_t x, int16_t y, int16_t z, uint32_t nbSteps); @@ -35,7 +39,8 @@ namespace Pinetime { uint32_t GetTripSteps() const { return currentTripSteps; } - bool ShouldWakeUp(bool isSleeping); + bool Should_ShakeWake(); + bool Should_RaiseWake(bool isSleeping); void IsSensorOk(bool isOk); bool IsSensorOk() const { @@ -59,6 +64,11 @@ namespace Pinetime { bool isSensorOk = false; DeviceTypes deviceType = DeviceTypes::Unknown; Pinetime::Controllers::MotionService* service = nullptr; + + int16_t lastXForShake = 0; + int16_t lastYForShake = 0; + int16_t lastZForShake = 0; + uint32_t lastShakeTime = 0; }; } } \ No newline at end of file -- cgit v1.2.3-70-g09d2