refactor(combos): Reduce RAM usage, simplify config (#2849)

* Reference combos by index, not 32-bit pointers, and store bitfields
instead of arrays in several places, to bring down our flash/RAM usage.
* Use bit field to track candidate combos, to avoid needing an explicit
`ZMK_COMBO_MAX_COMBOS_PER_KEY` setting.
* Determine the max keys per combo automatically from the devicetree,
so we remove the ZMK_COMBO_MAX_KEYS_PER_COMBO Kconfig symbol.
This commit is contained in:
Pete Johanson
2025-04-20 03:01:22 -06:00
committed by GitHub
parent d9576c5534
commit c4ee8ab86b
4 changed files with 196 additions and 211 deletions

View File

@@ -444,12 +444,16 @@ config ZMK_COMBO_MAX_PRESSED_COMBOS
default 4
config ZMK_COMBO_MAX_COMBOS_PER_KEY
int "Maximum number of combos per key"
default 5
int
default 0
help
Deprecated: Storage for combos is now determined automatically
config ZMK_COMBO_MAX_KEYS_PER_COMBO
int "Maximum number of keys per combo"
default 4
int
default 0
help
Deprecated: This is now auto-calculated based on `key-positions` in devicetree
# Combo options
endmenu