mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-07-26 14:58:12 +00:00
fix(eink): capture button edges via GPIO interrupt to survive display refresh
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>
This commit is contained in:
@@ -29,6 +29,7 @@ build_flags = ${nrf52_base.build_flags}
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
-D OFFLINE_QUEUE_SIZE=256
|
||||
-D DISPLAY_CLASS=GxEPDDisplay
|
||||
-D BUTTON_USE_INTERRUPTS=1
|
||||
-D UI_HAS_JOYSTICK=1
|
||||
-D UI_HAS_JOYSTICK_UPDOWN=1
|
||||
-D PIN_BUZZER=12
|
||||
|
||||
Reference in New Issue
Block a user