debounce_bit

Function debounce_bit 

Source
pub fn debounce_bit(
    prev_out: bool,
    curr_in: bool,
    counter: u8,
    hold_count: u8,
) -> (bool, u8)
Expand description

Debounce mask: require a stable hold_count frames before accepting changes.

  • prev_out: previous debounced output bit
  • curr_in: current raw input bit
  • counter: internal frame counter (call-site keeps one per bit) Returns: (new_out_bit, new_counter)