diff options
author | Tobias Arndt <[email protected]> | 2024-03-30 18:24:51 -0700 |
---|---|---|
committer | Pete Johanson <[email protected]> | 2024-03-30 19:13:39 -0700 |
commit | fe509c466f818471c677b069094d1e84e33ccf2e (patch) | |
tree | e517e8c634746200cba51f906f1935e25f55d768 | |
parent | e7d6519534231525e6173635061ab8e8bda5a997 (diff) | |
download | zmk-fe509c466f818471c677b069094d1e84e33ccf2e.tar.gz zmk-fe509c466f818471c677b069094d1e84e33ccf2e.zip |
fix(kscan): Enable charlieplex interrupts for single compatible device
Fixes #2201
-rw-r--r-- | app/module/drivers/kscan/kscan_gpio_charlieplex.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/app/module/drivers/kscan/kscan_gpio_charlieplex.c b/app/module/drivers/kscan/kscan_gpio_charlieplex.c index a4867aa320..3ecbcd6a0e 100644 --- a/app/module/drivers/kscan/kscan_gpio_charlieplex.c +++ b/app/module/drivers/kscan/kscan_gpio_charlieplex.c @@ -47,14 +47,7 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); #define USES_POLLING DT_INST_FOREACH_STATUS_OKAY(WITHOUT_INTR) > 0 #define USES_INTERRUPT DT_INST_FOREACH_STATUS_OKAY(WITH_INTR) > 0 -#if USES_POLLING && USES_INTERRUPT -#define USES_POLL_AND_INTR 1 -#else -#define USES_POLL_AND_INTR 0 -#endif - #define COND_ANY_POLLING(code) COND_CODE_1(USES_POLLING, code, ()) -#define COND_POLL_AND_INTR(code) COND_CODE_1(USES_POLL_AND_INTR, code, ()) #define COND_THIS_INTERRUPT(n, code) COND_CODE_1(INST_INTR_DEFINED(n), code, ()) #define KSCAN_INTR_CFG_INIT(inst_idx) GPIO_DT_SPEC_GET(DT_DRV_INST(inst_idx), interrupt_gpios) @@ -410,7 +403,7 @@ static const struct kscan_driver_api kscan_charlieplex_api = { }, \ .debounce_scan_period_ms = DT_INST_PROP(n, debounce_scan_period_ms), \ COND_ANY_POLLING((.poll_period_ms = DT_INST_PROP(n, poll_period_ms), )) \ - COND_POLL_AND_INTR((.use_interrupt = INST_INTR_DEFINED(n), )) \ + COND_THIS_INTERRUPT(n, (.use_interrupt = INST_INTR_DEFINED(n), )) \ COND_THIS_INTERRUPT(n, (.interrupt = KSCAN_INTR_CFG_INIT(n), ))}; \ \ DEVICE_DT_INST_DEFINE(n, &kscan_charlieplex_init, NULL, &kscan_charlieplex_data_##n, \ |