forked from kofal.net/zmk
refactor: Move away from deprecated label usages.
* Move away from DT_LABEL. * Move to DEVICE_DT_GET for non-behavior device access. * Move various drivers to `gpio_spec_dt` and `DT` related macros. * Remove mcp23017 while at it, since better upstream driver is available.
This commit is contained in:
committed by
Pete Johanson
parent
062f94d014
commit
09ed79a867
@@ -166,9 +166,10 @@ static int behavior_caps_word_init(const struct device *dev) {
|
||||
#define CAPS_WORD_LABEL(i, _n) DT_INST_LABEL(i)
|
||||
|
||||
#define PARSE_BREAK(i) \
|
||||
{.page = ZMK_HID_USAGE_PAGE(i), \
|
||||
.id = ZMK_HID_USAGE_ID(i), \
|
||||
.implicit_modifiers = SELECT_MODS(i)}
|
||||
{ \
|
||||
.page = ZMK_HID_USAGE_PAGE(i), .id = ZMK_HID_USAGE_ID(i), \
|
||||
.implicit_modifiers = SELECT_MODS(i) \
|
||||
}
|
||||
|
||||
#define BREAK_ITEM(i, n) PARSE_BREAK(DT_INST_PROP_BY_IDX(n, continue_list, i))
|
||||
|
||||
@@ -177,7 +178,7 @@ static int behavior_caps_word_init(const struct device *dev) {
|
||||
static 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)}, \
|
||||
.continuations = {LISTIFY(DT_INST_PROP_LEN(n, continue_list), BREAK_ITEM, (, ), n)}, \
|
||||
.continuations_count = DT_INST_PROP_LEN(n, continue_list), \
|
||||
}; \
|
||||
DEVICE_DT_INST_DEFINE(n, behavior_caps_word_init, NULL, &behavior_caps_word_data_##n, \
|
||||
|
||||
Reference in New Issue
Block a user