refactor(core): Use /omit-if-no-ref/ for behaviors.

* Use lesser-known DT features to skip behaviors not referenced
  in the user keymap
* Update the behaviors to skip code if no nodes found.
* Remove some empty config/data structs where unused in
  behaviors.
This commit is contained in:
Pete Johanson
2021-01-18 01:09:51 -05:00
parent b4d63fb52c
commit b84d29c384
26 changed files with 62 additions and 38 deletions

View File

@@ -22,7 +22,7 @@
LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
#if DT_NODE_EXISTS(DT_DRV_INST(0))
#if DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT)
#define ZMK_BHV_HOLD_TAP_MAX_HELD 10
#define ZMK_BHV_HOLD_TAP_MAX_CAPTURED_EVENTS 40
@@ -538,4 +538,4 @@ static struct behavior_hold_tap_data behavior_hold_tap_data;
DT_INST_FOREACH_STATUS_OKAY(KP_INST)
#endif
#endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */