From f3bb90f9e101c2f6d35e6577a52d51b778727dfa Mon Sep 17 00:00:00 2001 From: Jay Greco Date: Tue, 8 Jun 2021 17:59:35 -0700 Subject: [PATCH] fix(kscan): Fix nibble demux scan errors on encoder row + Add a 1us sleep to let the column selection settle in order to avoid spurious keypresses when row capacitance is high (like on the encoder row) --- app/drivers/kscan/kscan_gpio_demux.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/drivers/kscan/kscan_gpio_demux.c b/app/drivers/kscan/kscan_gpio_demux.c index 7e3515f5..06a5d277 100644 --- a/app/drivers/kscan/kscan_gpio_demux.c +++ b/app/drivers/kscan/kscan_gpio_demux.c @@ -113,6 +113,8 @@ struct kscan_gpio_item_config { &kscan_gpio_output_configs_##n(dev)[bit]; \ gpio_pin_set(out_dev, out_cfg->pin, state); \ } \ + /* Let the col settle before reading the rows */ \ + k_usleep(1); \ \ for (int i = 0; i < INST_MATRIX_INPUTS(n); i++) { \ /* Get the input device (port) */ \