Added Shake to wake

This commit is contained in:
Tim Keller
2021-09-27 01:20:44 +00:00
parent e0013e7304
commit d270275bd2
6 changed files with 55 additions and 14 deletions

View File

@@ -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;
};
}
}