fix(power): arm deep-sleep hold so per-pin gpio_hold_en actually holds#10438
Open
DatanoiseTV wants to merge 3 commits into
Open
fix(power): arm deep-sleep hold so per-pin gpio_hold_en actually holds#10438DatanoiseTV wants to merge 3 commits into
DatanoiseTV wants to merge 3 commits into
Conversation
doDeepSleep called gpio_hold_en for BUTTON_PIN and LORA_CS, but the ESP-IDF API contract is that gpio_hold_en alone only covers light sleep — deep sleep additionally requires gpio_deep_sleep_hold_en once before esp_deep_sleep_start to arm the holds across the deep- sleep boundary. Without it the pins float in DSLP, which on some boards leaks current through LORA_CS and on others triggers spurious wake from a noisy button line.
8 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes ESP32 deep-sleep GPIO retention by explicitly arming the global deep-sleep hold mechanism so existing per-pin gpio_hold_en() calls (e.g., BUTTON_PIN, LORA_CS) actually persist across the deep-sleep boundary. This prevents pins from floating during deep sleep, which can cause excess current draw and/or spurious activity on some boards.
Changes:
- Enable ESP32 deep-sleep GPIO holds in
doDeepSleep()viagpio_deep_sleep_hold_en()immediately before entering deep sleep.
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.
doDeepSleep called gpio_hold_en for BUTTON_PIN and LORA_CS, but the
ESP-IDF API contract is that gpio_hold_en alone only covers light
sleep — deep sleep additionally requires gpio_deep_sleep_hold_en
once before esp_deep_sleep_start to arm the holds across the deep-
sleep boundary. Without it the pins float in DSLP, which on some
boards leaks current through LORA_CS and on others triggers
spurious wake from a noisy button line.
Split out from #10425 — single-concern PR.
Build verification
pio run -e t-deck-tftsucceeds, no new warnings.Attestations
t-deck-tftonly.