-
-
Notifications
You must be signed in to change notification settings - Fork 938
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor doNotGoToSleep to a wakelock counter #2107
Conversation
Build size and comparison to main:
|
Couple rebase mistakes breaking build I'll patch them this evening |
Rebased to resolve conflicts |
For InfiniTime PR InfiniTimeOrg/InfiniTime#2107 a new systemtask file is introduced `WakeLock.h` and `WakeLock.cpp`. If available add those files to the build target to support the current `main` and the new `WakeLock` using redesign.
For InfiniTime PR InfiniTimeOrg/InfiniTime#2107 a new systemtask file is introduced `WakeLock.h` and `WakeLock.cpp`. If available add those files to the build target to support the current `main` and the new `WakeLock` using redesign.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the InfiniSim to use WakeLock.cpp
if it is available, fixing this PR build pipeline
InfiniTimeOrg/InfiniSim#150
Just the little newline and we're good to go from my side
For InfiniTime PR InfiniTimeOrg/InfiniTime#2107 a new systemtask file is introduced `WakeLock.h` and `WakeLock.cpp`. If available add those files to the build target to support the current `main` and the new `WakeLock` using redesign.
merge conflict after #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... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also mess up formating on rebases 😁 That's why I love the CI job checking it for me ^^
LGTM
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.