diff options
Diffstat (limited to 'src/components/motion/MotionController.h')
| -rw-r--r-- | src/components/motion/MotionController.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/components/motion/MotionController.h b/src/components/motion/MotionController.h index f80b11b..297db59 100644 --- a/src/components/motion/MotionController.h +++ b/src/components/motion/MotionController.h @@ -25,6 +25,9 @@ namespace Pinetime { int16_t Z() const { return z; } + int16_t LastY() const { + return lastY; + } uint32_t NbSteps() const { return nbSteps; } @@ -36,9 +39,10 @@ namespace Pinetime { return currentTripSteps; } + bool ShouldRaiseWake() const; bool Should_ShakeWake(uint16_t thresh); - bool Should_RaiseWake(bool isSleeping); int32_t currentShakeSpeed(); + bool ShouldLowerSleep() const; void IsSensorOk(bool isOk); bool IsSensorOk() const { return isSensorOk; @@ -54,9 +58,10 @@ namespace Pinetime { private: uint32_t nbSteps; uint32_t currentTripSteps = 0; - int16_t x; - int16_t y; - int16_t z; + int16_t x = 0; + int16_t y = 0; + int16_t z = 0; + int16_t lastY = 0; int16_t lastYForWakeUp = 0; bool isSensorOk = false; DeviceTypes deviceType = DeviceTypes::Unknown; @@ -69,4 +74,4 @@ namespace Pinetime { uint32_t lastShakeTime = 0; }; } -}
\ No newline at end of file +} |
