RAK3401: powerOff() override + AIN1 SENSE LOW wake from SYSTEMOFF 🤖🤖#2642
Open
disq wants to merge 1 commit into
Open
RAK3401: powerOff() override + AIN1 SENSE LOW wake from SYSTEMOFF 🤖🤖#2642disq wants to merge 1 commit into
disq wants to merge 1 commit into
Conversation
Two board-level pieces from dorfman2's PR meshcore-dev#2414 that are useful for any RAK3401 firmware, not just the repeater variant the PR targets: 1. RAK3401Board::powerOff() override — routes _board->powerOff() through initiateShutdown(SHUTDOWN_REASON_USER) so the shutdown reason is properly tagged in GPREGRET2 instead of falling through to the base class default. 2. AIN1 GPIO SENSE LOW config in initiateShutdown() — when an env defines PIN_USER_BTN_ANA, configure that pin with pull-up + SENSE LOW before entering SYSTEMOFF, so pressing the AIN1 button wakes the board from the off state via the GPIO LATCH/SENSE mechanism. Waits for button release first (level-triggered SENSE would otherwise wake immediately if the user is still holding the button when we arm it). The repeater-specific UI redesign, status screen, and simple_repeater main.cpp button handler from the same PR are out of scope here; the companion radio UI tree already has its own equivalent button handling in examples/companion_radio/ui-new/UITask.cpp. Co-Authored-By: dorfman2 <noreply@github.com> Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Ah @disq I see what you meant now. I was too focused on the UI portion of the code. Would love to see this implemented! |
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.
Two board-level pieces from @dorfman2's #2414 that are useful for any RAK3401 firmware, not just the repeater variant that PR targets.
What this changes
RAK3401Board::powerOff()override (variants/rak3401/RAK3401Board.h) — routes_board->powerOff()throughinitiateShutdown(SHUTDOWN_REASON_USER)so the shutdown reason is properly tagged inGPREGRET2instead of falling through to the base class default.AIN1 GPIO SENSE LOW config in
initiateShutdown()(variants/rak3401/RAK3401Board.cpp) — when an env definesPIN_USER_BTN_ANA, configure that pin with pull-up +SENSE_Lowbefore entering SYSTEMOFF, so pressing the AIN1 button wakes the board from the off state via the GPIOLATCH/SENSEmechanism. Waits for button release first (level-triggered SENSE would otherwise wake immediately if the user is still holding the button when we arm it).What this does NOT include
The repeater-specific UI redesign, status screen, and
simple_repeater/main.cppbutton handler from #2414 are out of scope here — the companion_radio UI tree already has its own equivalent button handling inexamples/companion_radio/ui-new/UITask.cpp. This PR cleanly lifts only the universally-beneficial board-level pieces; #2414 can land independently with the repeater UI work on top.Testing
Verified on RAK3401 + RAK19007 + companion_radio_ble build:
_board->powerOff()from the companion UI menu correctly enters SYSTEMOFF.🤖 Generated with Claude Code