Have isSleeping be checked by SystemTask, and fix incorrect array size
This commit is contained in:
parent
a6d9028f86
commit
a90d44f664
@ -66,11 +66,12 @@ int32_t MotionController::currentShakeSpeed() {
|
|||||||
return accumulatedspeed;
|
return accumulatedspeed;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MotionController::ShouldSleep(bool isSleeping) {
|
bool MotionController::ShouldSleep() {
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
|
|
||||||
if (y >= lastYForSleep + 192 && !isSleeping)
|
if (y >= lastYForSleep + 192) {
|
||||||
ret = true;
|
ret = true;
|
||||||
|
}
|
||||||
|
|
||||||
lastYForSleep = (y > 320) ? y : 320;
|
lastYForSleep = (y > 320) ? y : 320;
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ namespace Pinetime {
|
|||||||
bool Should_ShakeWake(uint16_t thresh);
|
bool Should_ShakeWake(uint16_t thresh);
|
||||||
bool Should_RaiseWake(bool isSleeping);
|
bool Should_RaiseWake(bool isSleeping);
|
||||||
int32_t currentShakeSpeed();
|
int32_t currentShakeSpeed();
|
||||||
bool ShouldSleep(bool isSleeping);
|
bool ShouldSleep();
|
||||||
void IsSensorOk(bool isOk);
|
void IsSensorOk(bool isOk);
|
||||||
bool IsSensorOk() const {
|
bool IsSensorOk() const {
|
||||||
return isSensorOk;
|
return isSensorOk;
|
||||||
|
@ -504,7 +504,7 @@ void SystemTask::UpdateMotion() {
|
|||||||
GoToRunning();
|
GoToRunning();
|
||||||
}
|
}
|
||||||
if (settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::LowerWrist)) {
|
if (settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::LowerWrist)) {
|
||||||
if (motionController.ShouldSleep(isSleeping))
|
if (motionController.ShouldSleep() && !isSleeping)
|
||||||
PushMessage(Messages::GoToSleep);
|
PushMessage(Messages::GoToSleep);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user