fix:change button press logic to reduce spurious presses from EM noise#19
Merged
fix:change button press logic to reduce spurious presses from EM noise#19
Conversation
Replace the rate-limit debounce with a multi-sample stability filter that requires 3 consecutive matching reads (~200-300ms) before accepting a state change. The prior logic accepted any single LOW sample caught at the 100ms poll instant, so microsecond-scale transients — such as cellular modem RF coupling onto the external button wire — were registering as phantom clicks and triggering demo/transit lock. Also gate the Cygnet onboard button (PC13 USER_BTN) behind DEBUG_MODE. PC13 is noise-prone and adds another surface for false LOW reads in field units that already have an external panel-mount button. Fix the double-click window so it waits the full triple-click timeout, matching the single-click path. This prevents a slow intended triple from short-circuiting into a demo-lock toggle. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <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
USER_BTN(PC13) behindDEBUG_MODE; PC13 is noise-prone and isn't needed on field units that have an external panel-mount button.Test plan
DEBUG_MODEbuild still responds to the onboard Cygnet button🤖 Generated with Claude Code