diff options
| author | Tim Keller <geekboy1011@gmail.com> | 2021-09-27 01:20:44 (GMT) |
|---|---|---|
| committer | Tim Keller <geekboy1011@gmail.com> | 2022-01-04 01:57:18 (GMT) |
| commit | d270275bd2d1044cb4db9af8efc1d766617b07a1 (patch) | |
| tree | 182094108fbcbf4df0564a743cd47bd0a47cf052 /src/components/motion/MotionController.h | |
| parent | e0013e730448f4dc142e3610f970f22c807ac41e (diff) | |
Added Shake to wake
Diffstat (limited to 'src/components/motion/MotionController.h')
| -rw-r--r-- | src/components/motion/MotionController.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/components/motion/MotionController.h b/src/components/motion/MotionController.h index 3eac717..f9c285e 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 |
