mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-09-14 15:16:40 +00:00
pollHallSensor() acted on the raw pin reading immediately, unlike every other physical-input path in this file (MomentaryButton, pollCardKB()'s own last-raw edge check). A cheap mechanical reed switch -- one of the two sensor types the docs explicitly recommend wiring here, alongside a solid-state Hall IC -- can chatter for a few ms while the magnet crosses the trigger distance, so a poll every loop() tick during that window could flip _locked and fire _display->turnOff()/turnOn() repeatedly in that short span: wasted work on any panel, and a real cost on e-ink where each is a slow full-panel operation. A raw reading now has to hold steady for HALL_DEBOUNCE_MS (25ms, same threshold as MomentaryButton's ISR_DEBOUNCE_MS) before it replaces _hall_magnet_present and triggers the lock/unlock actions. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>