diff options
| author | mark9064 <30447455+mark9064@users.noreply.github.com> | 2024-08-23 00:15:24 +0100 |
|---|---|---|
| committer | NeroBurner <pyro4hell@gmail.com> | 2024-09-21 22:45:57 +0200 |
| commit | 7ca0418c82173fa1cff9537eaf1f030b5a712e9a (patch) | |
| tree | 6d62fcabb5c764dff72943a08a8c7e554fcd5043 /src/systemtask/SystemTask.h | |
| parent | c3d05901a05a274f30c15b8c0640b6ecdd973ac3 (diff) | |
Refactor doNotGoToSleep to a wakelock counter
Diffstat (limited to 'src/systemtask/SystemTask.h')
| -rw-r--r-- | src/systemtask/SystemTask.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/systemtask/SystemTask.h b/src/systemtask/SystemTask.h index 339587c1..8a4e5954 100644 --- a/src/systemtask/SystemTask.h +++ b/src/systemtask/SystemTask.h @@ -80,7 +80,7 @@ namespace Pinetime { void OnTouchEvent(); bool IsSleepDisabled() { - return doNotGoToSleep; + return wakeLocksHeld > 0; } Pinetime::Controllers::NimbleController& nimble() { @@ -124,7 +124,7 @@ namespace Pinetime { bool isBleDiscoveryTimerRunning = false; uint8_t bleDiscoveryTimer = 0; TimerHandle_t measureBatteryTimer; - bool doNotGoToSleep = false; + uint8_t wakeLocksHeld = 0; SystemTaskState state = SystemTaskState::Running; void HandleButtonAction(Controllers::ButtonActions action); |
