refactor(behaviors): Minor RAM usage tweaks (#2839)

Follow up cleanup of some config structs not marked as const.
This commit is contained in:
Pete Johanson
2025-02-26 11:17:23 -07:00
committed by GitHub
parent d2eb6de7ad
commit 2fe55c4c41
3 changed files with 5 additions and 7 deletions

View File

@@ -175,7 +175,7 @@ static int behavior_caps_word_init(const struct device *dev) {
#define KP_INST(n) \
static struct behavior_caps_word_data behavior_caps_word_data_##n = {.active = false}; \
static struct behavior_caps_word_config behavior_caps_word_config_##n = { \
static const struct behavior_caps_word_config behavior_caps_word_config_##n = { \
.index = n, \
.mods = DT_INST_PROP_OR(n, mods, MOD_LSFT), \
.continuations = {LISTIFY(DT_INST_PROP_LEN(n, continue_list), BREAK_ITEM, (, ), n)}, \

View File

@@ -378,9 +378,6 @@ static int behavior_sticky_key_init(const struct device *dev) {
return 0;
}
struct behavior_sticky_key_data {};
static struct behavior_sticky_key_data behavior_sticky_key_data;
#define KP_INST(n) \
static const struct behavior_sticky_key_config behavior_sticky_key_config_##n = { \
.behavior = ZMK_KEYMAP_EXTRACT_BINDING(0, DT_DRV_INST(n)), \
@@ -389,7 +386,7 @@ static struct behavior_sticky_key_data behavior_sticky_key_data;
.lazy = DT_INST_PROP(n, lazy), \
.ignore_modifiers = DT_INST_PROP(n, ignore_modifiers), \
}; \
BEHAVIOR_DT_INST_DEFINE(n, behavior_sticky_key_init, NULL, &behavior_sticky_key_data, \
BEHAVIOR_DT_INST_DEFINE(n, behavior_sticky_key_init, NULL, NULL, \
&behavior_sticky_key_config_##n, POST_KERNEL, \
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_sticky_key_driver_api);