Browse Source

input: kbd_matrix: clear unstable state correctly on release

The state variable to tracking the unstable state of a key is currently
being cleared based on the bit value, which means that on release it's
not being cleared at all. Fix that by clearing using the bit mask
instead.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
pull/66116/head
Fabio Baltieri 2 years ago committed by Fabio Baltieri
parent
commit
f4bf74e402
  1. 2
      drivers/input/input_kbd_matrix.c

2
drivers/input/input_kbd_matrix.c

@ -174,7 +174,7 @@ static void input_kbd_matrix_update_state(const struct device *dev) @@ -174,7 +174,7 @@ static void input_kbd_matrix_update_state(const struct device *dev)
continue;
}
cfg->matrix_unstable_state[c] &= ~row_bit;
cfg->matrix_unstable_state[c] &= ~mask;
/* Check if there was a change in the stable state */
if ((cfg->matrix_stable_state[c] & mask) == row_bit) {

Loading…
Cancel
Save