From 3ecb9c264e5ab4aa14e0863dd9cd5b52bb260ee6 Mon Sep 17 00:00:00 2001 From: Peter Johanson Date: Wed, 1 Jan 2025 15:57:34 -0700 Subject: [PATCH] fix(combos): Properly report combos len with emply block Handle the scenario where there is an empty combos block and return a zero combos length. --- app/include/zmk/combos.h | 8 ++++---- .../processors/behaviors_hold_tap/native_posix_64.keymap | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/include/zmk/combos.h b/app/include/zmk/combos.h index a7166dff583..d93006f686a 100644 --- a/app/include/zmk/combos.h +++ b/app/include/zmk/combos.h @@ -8,9 +8,9 @@ #include -#define ZMK_COMBOS_UTIL_ONE(n) 1 +#define ZMK_COMBOS_UTIL_ONE(n) +1 #define ZMK_COMBOS_LEN \ - COND_CODE_1( \ - DT_HAS_COMPAT_STATUS_OKAY(zmk_combos), \ - (DT_FOREACH_CHILD_STATUS_OKAY_SEP(DT_INST(0, zmk_combos), ZMK_COMBOS_UTIL_ONE, (+))), (0)) \ No newline at end of file + COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(zmk_combos), \ + (0 DT_FOREACH_CHILD_STATUS_OKAY(DT_INST(0, zmk_combos), ZMK_COMBOS_UTIL_ONE)), \ + (0)) \ No newline at end of file diff --git a/app/tests/pointing/mouse-move/processors/behaviors_hold_tap/native_posix_64.keymap b/app/tests/pointing/mouse-move/processors/behaviors_hold_tap/native_posix_64.keymap index eb1d8f02795..092a20a03f7 100644 --- a/app/tests/pointing/mouse-move/processors/behaviors_hold_tap/native_posix_64.keymap +++ b/app/tests/pointing/mouse-move/processors/behaviors_hold_tap/native_posix_64.keymap @@ -18,6 +18,10 @@ }; / { + combos { + compatible = "zmk,combos"; + }; + keymap { compatible = "zmk,keymap"; label ="Default keymap";