mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-07-26 23:08:11 +00:00
E-ink panel refreshes block the main loop for 500ms-3.6s (GxEPD2's display.display() waits on the BUSY pin), and MomentaryButton::check() only ever samples the live pin level once per loop iteration. A full press+release that lands entirely inside a refresh is never sampled, not just delayed - users on WioTracker L1 Eink were losing taps. Add an opt-in ISR path (BUTTON_USE_INTERRUPTS) that latches each edge with its own timestamp into a small ring buffer from attachInterrupt(), independent of what the main loop is doing. check() replays buffered edges through the existing transition/multi-click logic afterwards, so click-duration and multi-click-window math still uses the edge's actual capture time rather than "now". Scoped to wio-tracker-l1-eink only for now: it's the one board this was reported against and the only GxEPDDisplay-class variant that currently builds clean on main. OLED boards refresh in ~20-30ms so polling already catches every press; analog-button boards (rak4631/rak3401) can't use attachInterrupt(CHANGE) at all. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>