Refactor doNotGoToSleep to a wakelock counter
Rather than tracking whether sleeping is disabled with a boolean, this moves it to a counter which records the number of requests to keep the device awake. When this counter is zero, sleeping is possible. This prevents one task from enabling sleeping when another task still wants sleeping disabled.
Build size and comparison to main:
| Section | Size | Difference |
|---|---|---|
| text | 374232B | 128B |
| data | 948B | 0B |
| bss | 63480B | 0B |
Couple rebase mistakes breaking build I'll patch them this evening Edit: done
Rebased to resolve conflicts
merge conflict after https://github.com/InfiniTimeOrg/InfiniTime/pull/2109 got merged. Please resolve them when doing the little newline
I also moved the destructor as IMO code should be minimally surprising, and now I think about it you don't really expect to find code in the header (except maybe const getters)
I always miss those formatting errors when rebasing...