Adjust systemtask to respect doNotGoToSleep.

This commit is contained in:
Tim Keller 2021-11-12 02:11:39 +00:00 committed by JF
parent 048ecd41e4
commit f1fc7ee659

View file

@ -280,6 +280,9 @@ void SystemTask::Work() {
}
} break;
case Messages::GoToSleep:
if (doNotGoToSleep) {
return;
}
isGoingToSleep = true;
NRF_LOG_INFO("[systemtask] Going to sleep");
xTimerStop(idleTimer, 0);
@ -506,7 +509,7 @@ void SystemTask::OnTouchEvent() {
}
void SystemTask::PushMessage(System::Messages msg) {
if (msg == Messages::GoToSleep) {
if (msg == Messages::GoToSleep && !doNotGoToSleep) {
isGoingToSleep = true;
}