refactor(keymap): Reduce flash usage for studio builds (#2771)

When building for ZMK Studio, we can use the constant stock keymap
for init of the in-memory keymap, to avoid duplicate flash usage
for the keymap from the devicetree.
This commit is contained in:
Pete Johanson
2025-01-15 14:51:26 -07:00
committed by GitHub
parent c367d8f636
commit e4f1454e0b
2 changed files with 17 additions and 7 deletions

View File

@@ -10,7 +10,10 @@
#define ZMK_LAYER_CHILD_LEN_PLUS_ONE(node) 1 +
#define ZMK_KEYMAP_LAYERS_LEN \
(DT_FOREACH_CHILD(DT_INST(0, zmk_keymap), ZMK_LAYER_CHILD_LEN_PLUS_ONE) 0)
(COND_CODE_1( \
IS_ENABLED(CONFIG_ZMK_STUDIO), \
(DT_FOREACH_CHILD(DT_INST(0, zmk_keymap), ZMK_LAYER_CHILD_LEN_PLUS_ONE)), \
(DT_FOREACH_CHILD_STATUS_OKAY(DT_INST(0, zmk_keymap), ZMK_LAYER_CHILD_LEN_PLUS_ONE))) 0)
/**
* @brief A layer ID is a stable identifier to refer to a layer, regardless of ordering.