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;
|
||||
}
|
||||
|
||||
bool MotionController::ShouldSleep(bool isSleeping) {
|
||||
bool MotionController::ShouldSleep() {
|
||||
bool ret = false;
|
||||
|
||||
if (y >= lastYForSleep + 192 && !isSleeping)
|
||||
if (y >= lastYForSleep + 192) {
|
||||
ret = true;
|
||||
}
|
||||
|
||||
lastYForSleep = (y > 320) ? y : 320;
|
||||
|
||||
|
@ -39,7 +39,7 @@ namespace Pinetime {
|
||||
bool Should_ShakeWake(uint16_t thresh);
|
||||
bool Should_RaiseWake(bool isSleeping);
|
||||
int32_t currentShakeSpeed();
|
||||
bool ShouldSleep(bool isSleeping);
|
||||
bool ShouldSleep();
|
||||
void IsSensorOk(bool isOk);
|
||||
bool IsSensorOk() const {
|
||||
return isSensorOk;
|
||||
|
@ -504,7 +504,7 @@ void SystemTask::UpdateMotion() {
|
||||
GoToRunning();
|
||||
}
|
||||
if (settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::LowerWrist)) {
|
||||
if (motionController.ShouldSleep(isSleeping))
|
||||
if (motionController.ShouldSleep() && !isSleeping)
|
||||
PushMessage(Messages::GoToSleep);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user