Skip to content

Support interrupt-based button triggering #4

@cleishm

Description

@cleishm

Add an interrupt-based triggering mode as an alternative to polling.

The current implementation only supports polling mode, where button GPIO levels are sampled on a periodic timer. This works but is less responsive and efficient than interrupt-driven detection.

Proposal:

  • Register a GPIO ISR handler for the button pin.
  • On interrupt, disable further interrupts for that pin and start a one-shot debounce timer.
  • When the debounce timer fires, read the stable GPIO level and proceed with normal press/release/autorepeat/long-press handling via the existing polling timer.
  • Re-enable the GPIO interrupt on button release.

This allows buttons to trigger immediately, and be idle with zero CPU overhead until actually pressed, while still using the proven polling logic for timing-dependent features like autorepeat and long press.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions