fix(kscan): different matrices, different waits
This commit is contained in:
parent
50d2c8d3fc
commit
7e2a45b582
2 changed files with 23 additions and 9 deletions
|
@ -31,12 +31,7 @@ config ZMK_KSCAN_GPIO_MATRIX
|
||||||
default $(dt_compat_enabled,$(DT_COMPAT_ZMK_KSCAN_GPIO_MATRIX))
|
default $(dt_compat_enabled,$(DT_COMPAT_ZMK_KSCAN_GPIO_MATRIX))
|
||||||
select ZMK_KSCAN_GPIO_DRIVER
|
select ZMK_KSCAN_GPIO_DRIVER
|
||||||
|
|
||||||
config ZMK_KSCAN_GPIO_ROUND_ROBIN_MATRIX
|
if ZMK_KSCAN_GPIO_MATRIX
|
||||||
bool
|
|
||||||
default $(dt_compat_enabled,$(DT_COMPAT_ZMK_KSCAN_GPIO_ROUND_ROBIN_MATRIX))
|
|
||||||
select ZMK_KSCAN_GPIO_DRIVER
|
|
||||||
|
|
||||||
if ZMK_KSCAN_GPIO_MATRIX || ZMK_KSCAN_GPIO_ROUND_ROBIN_MATRIX
|
|
||||||
|
|
||||||
config ZMK_KSCAN_MATRIX_WAIT_BETWEEN_OUTPUTS
|
config ZMK_KSCAN_MATRIX_WAIT_BETWEEN_OUTPUTS
|
||||||
int "Ticks to wait between each output when scanning"
|
int "Ticks to wait between each output when scanning"
|
||||||
|
@ -50,6 +45,25 @@ config ZMK_KSCAN_MATRIX_WAIT_BETWEEN_OUTPUTS
|
||||||
|
|
||||||
endif # ZMK_KSCAN_GPIO_MATRIX
|
endif # ZMK_KSCAN_GPIO_MATRIX
|
||||||
|
|
||||||
|
config ZMK_KSCAN_GPIO_ROUND_ROBIN_MATRIX
|
||||||
|
bool
|
||||||
|
default $(dt_compat_enabled,$(DT_COMPAT_ZMK_KSCAN_GPIO_ROUND_ROBIN_MATRIX))
|
||||||
|
select ZMK_KSCAN_GPIO_DRIVER
|
||||||
|
|
||||||
|
if ZMK_KSCAN_GPIO_ROUND_ROBIN_MATRIX
|
||||||
|
|
||||||
|
config ZMK_KSCAN_ROUND_ROBIN_MATRIX_WAIT_BETWEEN_OUTPUTS
|
||||||
|
int "Ticks to wait between each output when scanning round robin matrix"
|
||||||
|
default 0
|
||||||
|
help
|
||||||
|
When iterating over each output to drive it active, read inputs, then set
|
||||||
|
inactive again, some boards may take time for the previous output to
|
||||||
|
"settle" before reading inputs for the next active output column. In that
|
||||||
|
scenario, set this value to a positive value to configure the number of
|
||||||
|
usecs to wait after reading each column of keys.
|
||||||
|
|
||||||
|
endif # ZMK_KSCAN_GPIO_ROUND_ROBIN_MATRIX
|
||||||
|
|
||||||
config ZMK_KSCAN_MOCK_DRIVER
|
config ZMK_KSCAN_MOCK_DRIVER
|
||||||
bool
|
bool
|
||||||
default $(dt_compat_enabled,$(DT_COMPAT_ZMK_KSCAN_MOCK))
|
default $(dt_compat_enabled,$(DT_COMPAT_ZMK_KSCAN_MOCK))
|
||||||
|
|
|
@ -136,8 +136,8 @@ static int kscan_round_robin_matrix_read(const struct device *dev) {
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if CONFIG_ZMK_KSCAN_MATRIX_WAIT_BETWEEN_OUTPUTS > 0
|
#if CONFIG_ZMK_KSCAN_ROUND_ROBIN_MATRIX_WAIT_BETWEEN_OUTPUTS > 0
|
||||||
k_busy_wait(CONFIG_ZMK_KSCAN_MATRIX_WAIT_BETWEEN_OUTPUTS);
|
k_busy_wait(CONFIG_ZMK_KSCAN_ROUND_ROBIN_MATRIX_WAIT_BETWEEN_OUTPUTS);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue