summaryrefslogtreecommitdiff
path: root/src/components/motion/MotionController.h
diff options
context:
space:
mode:
authorMichele Bini <michele.bini@gmail.com>2022-04-09 16:47:37 (GMT)
committerMichele Bini <michele.bini@gmail.com>2022-04-09 16:49:44 (GMT)
commit42d0d1ad338c55ca44f7f4cbb880c40e293b0d5c (patch)
treed580a2d098d2a96f565d48ac1fcd90e59d34b5eb /src/components/motion/MotionController.h
parent4d9c76afdacddb1f766c74789f49f3dc96aead9a (diff)
Integrate FintasticMan's RaiseWake and LowerToSleep mods
Diffstat (limited to 'src/components/motion/MotionController.h')
-rw-r--r--src/components/motion/MotionController.h15
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
+}