Skip to content

Commit f0a77b8

Browse files
authored
fix(combos): Properly report combos len with emply block (#2739)
Handle the scenario where there is an empty combos block and return a zero combos length.
1 parent 85aba16 commit f0a77b8

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

app/include/zmk/combos.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
#include <zephyr/devicetree.h>
1010

11-
#define ZMK_COMBOS_UTIL_ONE(n) 1
11+
#define ZMK_COMBOS_UTIL_ONE(n) +1
1212

1313
#define ZMK_COMBOS_LEN \
14-
COND_CODE_1( \
15-
DT_HAS_COMPAT_STATUS_OKAY(zmk_combos), \
16-
(DT_FOREACH_CHILD_STATUS_OKAY_SEP(DT_INST(0, zmk_combos), ZMK_COMBOS_UTIL_ONE, (+))), (0))
14+
COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(zmk_combos), \
15+
(0 DT_FOREACH_CHILD_STATUS_OKAY(DT_INST(0, zmk_combos), ZMK_COMBOS_UTIL_ONE)), \
16+
(0))

app/tests/pointing/mouse-move/processors/behaviors_hold_tap/native_posix_64.keymap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
};
1919

2020
/ {
21+
combos {
22+
compatible = "zmk,combos";
23+
};
24+
2125
keymap {
2226
compatible = "zmk,keymap";
2327
label ="Default keymap";

0 commit comments

Comments
 (0)