Fix random-mode toggle when altdomestick=1 is active#68
Merged
thePunderWoman merged 1 commit intomainfrom Apr 24, 2026
Merged
Conversation
When alt is held with altdomestick=1, enableAbsoluteStickMode() was overwriting fState even when the dome was already in random mode. This caused toggleRandomMode() to see isRandomMode()==false and re-enable instead of disable, making the toggle always turn random on. Two-part fix: - Don't engage abs-stick mode at all when random mode is active, so the state stays kStateRandom while the alt button is held and the toggle check sees the correct value. - Save/restore fState across abs-stick engage/disengage so other states (e.g. kStateGoToAngle) are also preserved on alt-release. Also updates example_config.txt to move the random-toggle action from lb=5 (long-press) to ab=5 (alt-press), matching the intended use. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
altdomestick=1,enableAbsoluteStickMode()was overwritingfStateeven when the dome was in random mode. This causedtoggleRandomMode()to seeisRandomMode()==falseand callenableRandomMode()instead ofdisableRandomMode(), so the toggle always turned random on and never off.isRandomMode()is true — keepsfStateaskStateRandomwhile alt is held so the toggle check works correctly.fStateacross abs-stick engage/disengage as a general improvement (preserves any other active state, e.g.kStateGoToAngle).example_config.txtto move the random-toggle action fromlb=5(long-press) toab=5(alt-press).Test plan
altdomestick=1andab=5,9,0: toggle random mode on, then hold alt and press button 5 — random mode should turn offpio test -e nativepasses (409/409)pio runsucceeds🤖 Generated with Claude Code