mirror of https://github.com/zmkfirmware/zmk.git
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.
This commit is contained in:
parent
85aba16eec
commit
f0a77b888a
|
|
@ -8,9 +8,9 @@
|
|||
|
||||
#include <zephyr/devicetree.h>
|
||||
|
||||
#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))
|
||||
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))
|
||||
|
|
@ -18,6 +18,10 @@
|
|||
};
|
||||
|
||||
/ {
|
||||
combos {
|
||||
compatible = "zmk,combos";
|
||||
};
|
||||
|
||||
keymap {
|
||||
compatible = "zmk,keymap";
|
||||
label ="Default keymap";
|
||||
|
|
|
|||
Loading…
Reference in New Issue