Skip to content

fix:change button press logic to reduce spurious presses from EM noise#19

Merged
bsatrom merged 2 commits intomainfrom
bsatrom/lock-spurious-trigger
Apr 17, 2026
Merged

fix:change button press logic to reduce spurious presses from EM noise#19
bsatrom merged 2 commits intomainfrom
bsatrom/lock-spurious-trigger

Conversation

@bsatrom
Copy link
Copy Markdown
Member

@bsatrom bsatrom commented Apr 17, 2026

Summary

  • Replace the rate-limit debounce in MainTask with a multi-sample stability filter (3 consecutive matching reads, ~200-300ms) so cellular RF transients coupled onto the external button wire no longer register as phantom clicks triggering demo/transit lock.
  • Gate the Cygnet onboard USER_BTN (PC13) behind DEBUG_MODE; PC13 is noise-prone and isn't needed on field units that have an external panel-mount button.
  • Fix the double-click window to wait the full triple-click timeout so a slow intended triple-click no longer short-circuits into a demo-lock toggle.
  • Bump firmware version to 1.7.2.

Test plan

  • Flash to a device and verify transit/demo lock no longer trigger spontaneously through multiple sync cycles
  • Confirm intended single / double / triple clicks still toggle transit lock / demo lock / mute respectively
  • Confirm DEBUG_MODE build still responds to the onboard Cygnet button

🤖 Generated with Claude Code

bsatrom and others added 2 commits April 16, 2026 20:08
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>
@bsatrom bsatrom merged commit bd456f4 into main Apr 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant