feat: /tmp/stay_awake and /tmp/stay_alive suspend-inhibit lock files#756
Draft
nborodikhin wants to merge 1 commit into
Draft
feat: /tmp/stay_awake and /tmp/stay_alive suspend-inhibit lock files#756nborodikhin wants to merge 1 commit into
nborodikhin wants to merge 1 commit into
Conversation
Two well-known marker files let external processes (Pak scripts, debug sessions, long-running tools) defer the auto power-save transitions: /tmp/stay_awake - blocks autosleep (no screen-off, no deep sleep) /tmp/stay_alive - blocks deep sleep only (screen may still blank) stay_awake plugs into PWR_preventAutosleep so the autosleep timer is pinned while the file exists; manual SLEEP-button and HW-requested sleep paths are unaffected. Both files are also checked in PWR_waitForWake's deferral loop next to the existing is_charging branch, so deep sleep is skipped while either lock is present (with the same 60s re-check cadence). This also catches the race where stay_awake appears after the device already entered light sleep. /tmp is tmpfs on the device, so the locks evaporate on reboot. Addresses LoveRetro#755.
Member
|
I remember a brief discussion about something similar a while back, but its not because paks cant override sleep, the opposite really. See my comment on #755, this should not be necessary for any current pak. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two standard
/tmp/marker files that let external processes deferNextUI's automatic power-save transitions:
/tmp/stay_awake— blocks autosleep (no screen-off, no deep sleep)/tmp/stay_alive— blocks deep sleep only (screen may still blank)This PR addresses #755
Changes
stay_awakeplugs intoPWR_preventAutosleep()so the autosleep timeris pinned while the file exists. Manual SLEEP-button and HW-requested
sleep paths are unaffected.
PWR_waitForWake()'s deferral loop nextto the existing
is_chargingbranch, so deep sleep is skippedwhile either lock is present (same 60s re-check cadence).
This also catches the race where
stay_awakeappearsafter the device already entered light sleep.
Test plan