struct Classifier {
debouncer: Debouncer,
state: State,
}Expand description
Debounced press/hold/click state machine, polled at POLL.
Fields§
§debouncer: DebouncerLevel filter feeding the state machine.
state: StateCurrent click-sequence phase.
Implementations§
Source§impl Classifier
impl Classifier
Sourcefn new(pressed: bool) -> Self
fn new(pressed: bool) -> Self
Creates a classifier synced to the current level.
A button already held at spawn is treated as an in-progress hold
with ButtonEvent::LongHold suppressed, so a reboot triggered by
a held button (e.g. LongHold → Reboot) waits for the release
before it accepts a new event instead of looping.
Sourcefn update(&mut self, pressed: bool, now: Instant) -> Option<ButtonEvent>
fn update(&mut self, pressed: bool, now: Instant) -> Option<ButtonEvent>
Feeds one poll of the raw level (pressed = active-low reading)
and returns the event that completed, if any.