Browse Source

refactor(core): Move away from deprecated DT API.

* Move to `DEVICE_DT_INST_DEFINE` everywhere.

See: https://docs.zephyrproject.org/2.5.0/releases/release-notes-2.5.html#deprecated-in-this-release
PR: https://github.com/zmkfirmware/zmk/pull/736
xmkb
Pete Johanson 4 years ago
parent
commit
2a69f31eb0
  1. 6
      app/drivers/kscan/kscan_composite.c
  2. 6
      app/drivers/kscan/kscan_gpio_demux.c
  3. 6
      app/drivers/kscan/kscan_gpio_direct.c
  4. 6
      app/drivers/kscan/kscan_gpio_matrix.c
  5. 6
      app/drivers/kscan/kscan_mock.c
  6. 4
      app/drivers/sensor/battery_voltage_divider/battery_voltage_divider.c
  7. 6
      app/drivers/sensor/ec11/ec11.c
  8. 6
      app/src/behaviors/behavior_bt.c
  9. 4
      app/src/behaviors/behavior_ext_power.c
  10. 8
      app/src/behaviors/behavior_hold_tap.c
  11. 6
      app/src/behaviors/behavior_key_press.c
  12. 9
      app/src/behaviors/behavior_mod_morph.c
  13. 6
      app/src/behaviors/behavior_momentary_layer.c
  14. 6
      app/src/behaviors/behavior_none.c
  15. 4
      app/src/behaviors/behavior_outputs.c
  16. 6
      app/src/behaviors/behavior_reset.c
  17. 6
      app/src/behaviors/behavior_rgb_underglow.c
  18. 7
      app/src/behaviors/behavior_sensor_rotate_key_press.c
  19. 6
      app/src/behaviors/behavior_sticky_key.c
  20. 4
      app/src/behaviors/behavior_to_layer.c
  21. 6
      app/src/behaviors/behavior_toggle_layer.c
  22. 7
      app/src/behaviors/behavior_transparent.c
  23. 10
      app/src/ext_power_generic.c

6
app/drivers/kscan/kscan_composite.c

@ -108,6 +108,6 @@ static const struct kscan_composite_config kscan_composite_config = {};
static struct kscan_composite_data kscan_composite_data; static struct kscan_composite_data kscan_composite_data;
DEVICE_AND_API_INIT(kscan_composite, DT_INST_LABEL(0), kscan_composite_init, &kscan_composite_data, DEVICE_DT_INST_DEFINE(0, kscan_composite_init, device_pm_control_nop, &kscan_composite_data,
&kscan_composite_config, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &kscan_composite_config, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&mock_driver_api); &mock_driver_api);

6
app/drivers/kscan/kscan_gpio_demux.c

@ -248,9 +248,9 @@ struct kscan_gpio_item_config {
.cols = {UTIL_LISTIFY(INST_DEMUX_GPIOS(n), _KSCAN_GPIO_OUTPUT_CFG_INIT, n)}, \ .cols = {UTIL_LISTIFY(INST_DEMUX_GPIOS(n), _KSCAN_GPIO_OUTPUT_CFG_INIT, n)}, \
}; \ }; \
\ \
DEVICE_AND_API_INIT(kscan_gpio_##n, DT_INST_LABEL(n), kscan_gpio_init_##n, \ DEVICE_DT_INST_DEFINE(n, kscan_gpio_init_##n, device_pm_control_nop, &kscan_gpio_data_##n, \
&kscan_gpio_data_##n, &kscan_gpio_config_##n, APPLICATION, \ &kscan_gpio_config_##n, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY, \
CONFIG_APPLICATION_INIT_PRIORITY, &gpio_driver_api_##n); &gpio_driver_api_##n);
DT_INST_FOREACH_STATUS_OKAY(GPIO_INST_INIT) DT_INST_FOREACH_STATUS_OKAY(GPIO_INST_INIT)

6
app/drivers/kscan/kscan_gpio_direct.c

@ -238,9 +238,9 @@ static const struct kscan_driver_api gpio_driver_api = {
.inputs = {UTIL_LISTIFY(INST_INPUT_LEN(n), KSCAN_DIRECT_INPUT_ITEM, n)}, \ .inputs = {UTIL_LISTIFY(INST_INPUT_LEN(n), KSCAN_DIRECT_INPUT_ITEM, n)}, \
.num_of_inputs = INST_INPUT_LEN(n), \ .num_of_inputs = INST_INPUT_LEN(n), \
.debounce_period = DT_INST_PROP(n, debounce_period)}; \ .debounce_period = DT_INST_PROP(n, debounce_period)}; \
DEVICE_AND_API_INIT(kscan_gpio_##n, DT_INST_LABEL(n), kscan_gpio_init_##n, \ DEVICE_DT_INST_DEFINE(n, kscan_gpio_init_##n, device_pm_control_nop, &kscan_gpio_data_##n, \
&kscan_gpio_data_##n, &kscan_gpio_config_##n, POST_KERNEL, \ &kscan_gpio_config_##n, POST_KERNEL, CONFIG_ZMK_KSCAN_INIT_PRIORITY, \
CONFIG_ZMK_KSCAN_INIT_PRIORITY, &gpio_driver_api); &gpio_driver_api);
DT_INST_FOREACH_STATUS_OKAY(GPIO_INST_INIT) DT_INST_FOREACH_STATUS_OKAY(GPIO_INST_INIT)

6
app/drivers/kscan/kscan_gpio_matrix.c

@ -298,9 +298,9 @@ static int kscan_gpio_config_interrupts(const struct device **devices,
.rows = {UTIL_LISTIFY(INST_MATRIX_ROWS(n), _KSCAN_GPIO_ROW_CFG_INIT, n)}, \ .rows = {UTIL_LISTIFY(INST_MATRIX_ROWS(n), _KSCAN_GPIO_ROW_CFG_INIT, n)}, \
.cols = {UTIL_LISTIFY(INST_MATRIX_COLS(n), _KSCAN_GPIO_COL_CFG_INIT, n)}, \ .cols = {UTIL_LISTIFY(INST_MATRIX_COLS(n), _KSCAN_GPIO_COL_CFG_INIT, n)}, \
}; \ }; \
DEVICE_AND_API_INIT(kscan_gpio_##n, DT_INST_LABEL(n), kscan_gpio_init_##n, \ DEVICE_DT_INST_DEFINE(n, kscan_gpio_init_##n, device_pm_control_nop, &kscan_gpio_data_##n, \
&kscan_gpio_data_##n, &kscan_gpio_config_##n, APPLICATION, \ &kscan_gpio_config_##n, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY, \
CONFIG_APPLICATION_INIT_PRIORITY, &gpio_driver_api_##n); &gpio_driver_api_##n);
DT_INST_FOREACH_STATUS_OKAY(GPIO_INST_INIT) DT_INST_FOREACH_STATUS_OKAY(GPIO_INST_INIT)

6
app/drivers/kscan/kscan_mock.c

@ -88,8 +88,8 @@ static int kscan_mock_configure(const struct device *dev, kscan_callback_t callb
static struct kscan_mock_data kscan_mock_data_##n; \ static struct kscan_mock_data kscan_mock_data_##n; \
static const struct kscan_mock_config_##n kscan_mock_config_##n = { \ static const struct kscan_mock_config_##n kscan_mock_config_##n = { \
.events = DT_INST_PROP(n, events), .exit_after = DT_INST_PROP(n, exit_after)}; \ .events = DT_INST_PROP(n, events), .exit_after = DT_INST_PROP(n, exit_after)}; \
DEVICE_AND_API_INIT(kscan_mock_##n, DT_INST_LABEL(n), kscan_mock_init_##n, \ DEVICE_DT_INST_DEFINE(n, kscan_mock_init_##n, device_pm_control_nop, &kscan_mock_data_##n, \
&kscan_mock_data_##n, &kscan_mock_config_##n, APPLICATION, \ &kscan_mock_config_##n, APPLICATION, \
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &mock_driver_api_##n); CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &mock_driver_api_##n);
DT_INST_FOREACH_STATUS_OKAY(MOCK_INST_INIT) DT_INST_FOREACH_STATUS_OKAY(MOCK_INST_INIT)

4
app/drivers/sensor/battery_voltage_divider/battery_voltage_divider.c

@ -217,5 +217,5 @@ static const struct bvd_config bvd_cfg = {
.full_ohm = DT_INST_PROP(0, full_ohms), .full_ohm = DT_INST_PROP(0, full_ohms),
}; };
DEVICE_AND_API_INIT(bvd_dev, DT_INST_LABEL(0), &bvd_init, &bvd_data, &bvd_cfg, POST_KERNEL, DEVICE_DT_INST_DEFINE(0, &bvd_init, device_pm_control_nop, &bvd_data, &bvd_cfg, POST_KERNEL,
CONFIG_SENSOR_INIT_PRIORITY, &bvd_api); CONFIG_SENSOR_INIT_PRIORITY, &bvd_api);

6
app/drivers/sensor/ec11/ec11.c

@ -142,7 +142,7 @@ int ec11_init(const struct device *dev) {
.b_flags = DT_INST_GPIO_FLAGS(n, b_gpios), \ .b_flags = DT_INST_GPIO_FLAGS(n, b_gpios), \
COND_CODE_0(DT_INST_NODE_HAS_PROP(n, resolution), (1), (DT_INST_PROP(n, resolution))), \ COND_CODE_0(DT_INST_NODE_HAS_PROP(n, resolution), (1), (DT_INST_PROP(n, resolution))), \
}; \ }; \
DEVICE_AND_API_INIT(ec11_##n, DT_INST_LABEL(n), ec11_init, &ec11_data_##n, &ec11_cfg_##n, \ DEVICE_DT_INST_DEFINE(n, ec11_init, device_pm_control_nop, &ec11_data_##n, &ec11_cfg_##n, \
POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY, &ec11_driver_api); POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY, &ec11_driver_api);
DT_INST_FOREACH_STATUS_OKAY(EC11_INST) DT_INST_FOREACH_STATUS_OKAY(EC11_INST)

6
app/src/behaviors/behavior_bt.c

@ -49,7 +49,7 @@ static const struct behavior_driver_api behavior_bt_driver_api = {
.binding_released = on_keymap_binding_released, .binding_released = on_keymap_binding_released,
}; };
DEVICE_AND_API_INIT(behavior_bt, DT_INST_LABEL(0), behavior_bt_init, NULL, NULL, APPLICATION, DEVICE_DT_INST_DEFINE(0, behavior_bt_init, device_pm_control_nop, NULL, NULL, APPLICATION,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_bt_driver_api); CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_bt_driver_api);
#endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */ #endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */

4
app/src/behaviors/behavior_ext_power.c

@ -73,7 +73,7 @@ static const struct behavior_driver_api behavior_ext_power_driver_api = {
.binding_released = on_keymap_binding_released, .binding_released = on_keymap_binding_released,
}; };
DEVICE_AND_API_INIT(behavior_ext_power, DT_INST_LABEL(0), behavior_ext_power_init, NULL, NULL, DEVICE_DT_INST_DEFINE(0, behavior_ext_power_init, device_pm_control_nop, NULL, NULL, APPLICATION,
APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY, &behavior_ext_power_driver_api); CONFIG_APPLICATION_INIT_PRIORITY, &behavior_ext_power_driver_api);
#endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */ #endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */

8
app/src/behaviors/behavior_hold_tap.c

@ -605,10 +605,10 @@ static struct behavior_hold_tap_data behavior_hold_tap_data;
.flavor = DT_ENUM_IDX(DT_DRV_INST(n), flavor), \ .flavor = DT_ENUM_IDX(DT_DRV_INST(n), flavor), \
.retro_tap = DT_INST_PROP(n, retro_tap), \ .retro_tap = DT_INST_PROP(n, retro_tap), \
}; \ }; \
DEVICE_AND_API_INIT(behavior_hold_tap_##n, DT_INST_LABEL(n), behavior_hold_tap_init, \ DEVICE_DT_INST_DEFINE(n, behavior_hold_tap_init, device_pm_control_nop, \
&behavior_hold_tap_data, &behavior_hold_tap_config_##n, APPLICATION, \ &behavior_hold_tap_data, &behavior_hold_tap_config_##n, APPLICATION, \
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_hold_tap_driver_api); CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_hold_tap_driver_api);
DT_INST_FOREACH_STATUS_OKAY(KP_INST) DT_INST_FOREACH_STATUS_OKAY(KP_INST)
#endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */ #endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */

6
app/src/behaviors/behavior_key_press.c

@ -36,8 +36,8 @@ static const struct behavior_driver_api behavior_key_press_driver_api = {
.binding_pressed = on_keymap_binding_pressed, .binding_released = on_keymap_binding_released}; .binding_pressed = on_keymap_binding_pressed, .binding_released = on_keymap_binding_released};
#define KP_INST(n) \ #define KP_INST(n) \
DEVICE_AND_API_INIT(behavior_key_press_##n, DT_INST_LABEL(n), behavior_key_press_init, NULL, \ DEVICE_DT_INST_DEFINE(n, behavior_key_press_init, device_pm_control_nop, NULL, NULL, \
NULL, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \ APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \
&behavior_key_press_driver_api); &behavior_key_press_driver_api);
DT_INST_FOREACH_STATUS_OKAY(KP_INST) DT_INST_FOREACH_STATUS_OKAY(KP_INST)

9
app/src/behaviors/behavior_mod_morph.c

@ -90,10 +90,11 @@ static int behavior_mod_morph_init(const struct device *dev) { return 0; }
.mods = DT_INST_PROP(n, mods), \ .mods = DT_INST_PROP(n, mods), \
}; \ }; \
static struct behavior_mod_morph_data behavior_mod_morph_data_##n = {}; \ static struct behavior_mod_morph_data behavior_mod_morph_data_##n = {}; \
DEVICE_AND_API_INIT(behavior_mod_morph_##n, DT_INST_LABEL(n), behavior_mod_morph_init, \ DEVICE_DT_INST_DEFINE(n, behavior_mod_morph_init, device_pm_control_nop, \
&behavior_mod_morph_data_##n, &behavior_mod_morph_config_##n, APPLICATION, \ &behavior_mod_morph_data_##n, &behavior_mod_morph_config_##n, \
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_mod_morph_driver_api); APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \
&behavior_mod_morph_driver_api);
DT_INST_FOREACH_STATUS_OKAY(KP_INST) DT_INST_FOREACH_STATUS_OKAY(KP_INST)
#endif #endif

6
app/src/behaviors/behavior_momentary_layer.c

@ -39,6 +39,6 @@ static const struct behavior_mo_config behavior_mo_config = {};
static struct behavior_mo_data behavior_mo_data; static struct behavior_mo_data behavior_mo_data;
DEVICE_AND_API_INIT(behavior_mo, DT_INST_LABEL(0), behavior_mo_init, &behavior_mo_data, DEVICE_DT_INST_DEFINE(0, behavior_mo_init, device_pm_control_nop, &behavior_mo_data,
&behavior_mo_config, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_mo_config, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&behavior_mo_driver_api); &behavior_mo_driver_api);

6
app/src/behaviors/behavior_none.c

@ -34,7 +34,7 @@ static const struct behavior_driver_api behavior_none_driver_api = {
.binding_released = on_keymap_binding_released, .binding_released = on_keymap_binding_released,
}; };
DEVICE_AND_API_INIT(behavior_none, DT_INST_LABEL(0), behavior_none_init, NULL, NULL, APPLICATION, DEVICE_DT_INST_DEFINE(0, behavior_none_init, device_pm_control_nop, NULL, NULL, APPLICATION,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_none_driver_api); CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_none_driver_api);
#endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */ #endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */

4
app/src/behaviors/behavior_outputs.c

@ -42,7 +42,7 @@ static const struct behavior_driver_api behavior_outputs_driver_api = {
.binding_pressed = on_keymap_binding_pressed, .binding_pressed = on_keymap_binding_pressed,
}; };
DEVICE_AND_API_INIT(behavior_out, DT_INST_LABEL(0), behavior_out_init, NULL, NULL, APPLICATION, DEVICE_DT_INST_DEFINE(0, behavior_out_init, device_pm_control_nop, NULL, NULL, APPLICATION,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_outputs_driver_api); CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_outputs_driver_api);
#endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */ #endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */

6
app/src/behaviors/behavior_reset.c

@ -41,9 +41,9 @@ static const struct behavior_driver_api behavior_reset_driver_api = {
#define RST_INST(n) \ #define RST_INST(n) \
static const struct behavior_reset_config behavior_reset_config_##n = { \ static const struct behavior_reset_config behavior_reset_config_##n = { \
.type = DT_INST_PROP(n, type)}; \ .type = DT_INST_PROP(n, type)}; \
DEVICE_AND_API_INIT(behavior_reset_##n, DT_INST_LABEL(n), behavior_reset_init, NULL, \ DEVICE_DT_INST_DEFINE(n, behavior_reset_init, device_pm_control_nop, NULL, \
&behavior_reset_config_##n, APPLICATION, \ &behavior_reset_config_##n, APPLICATION, \
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_reset_driver_api); CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_reset_driver_api);
DT_INST_FOREACH_STATUS_OKAY(RST_INST) DT_INST_FOREACH_STATUS_OKAY(RST_INST)

6
app/src/behaviors/behavior_rgb_underglow.c

@ -136,8 +136,8 @@ static const struct behavior_driver_api behavior_rgb_underglow_driver_api = {
.binding_released = on_keymap_binding_released, .binding_released = on_keymap_binding_released,
}; };
DEVICE_AND_API_INIT(behavior_rgb_underglow, DT_INST_LABEL(0), behavior_rgb_underglow_init, NULL, DEVICE_DT_INST_DEFINE(0, behavior_rgb_underglow_init, device_pm_control_nop, NULL, NULL,
NULL, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&behavior_rgb_underglow_driver_api); &behavior_rgb_underglow_driver_api);
#endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */ #endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */

7
app/src/behaviors/behavior_sensor_rotate_key_press.c

@ -59,10 +59,9 @@ static const struct behavior_driver_api behavior_sensor_rotate_key_press_driver_
.sensor_binding_triggered = on_sensor_binding_triggered}; .sensor_binding_triggered = on_sensor_binding_triggered};
#define KP_INST(n) \ #define KP_INST(n) \
DEVICE_AND_API_INIT(behavior_sensor_rotate_key_press_##n, DT_INST_LABEL(n), \ DEVICE_DT_INST_DEFINE(n, behavior_sensor_rotate_key_press_init, device_pm_control_nop, NULL, \
behavior_sensor_rotate_key_press_init, NULL, NULL, APPLICATION, \ NULL, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \ &behavior_sensor_rotate_key_press_driver_api);
&behavior_sensor_rotate_key_press_driver_api);
DT_INST_FOREACH_STATUS_OKAY(KP_INST) DT_INST_FOREACH_STATUS_OKAY(KP_INST)

6
app/src/behaviors/behavior_sticky_key.c

@ -272,9 +272,9 @@ static struct behavior_sticky_key_data behavior_sticky_key_data;
.release_after_ms = DT_INST_PROP(n, release_after_ms), \ .release_after_ms = DT_INST_PROP(n, release_after_ms), \
.quick_release = DT_INST_PROP(n, quick_release), \ .quick_release = DT_INST_PROP(n, quick_release), \
}; \ }; \
DEVICE_AND_API_INIT(behavior_sticky_key_##n, DT_INST_LABEL(n), behavior_sticky_key_init, \ DEVICE_DT_INST_DEFINE(n, behavior_sticky_key_init, device_pm_control_nop, \
&behavior_sticky_key_data, &behavior_sticky_key_config_##n, APPLICATION, \ &behavior_sticky_key_data, &behavior_sticky_key_config_##n, APPLICATION, \
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_sticky_key_driver_api); CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_sticky_key_driver_api);
DT_INST_FOREACH_STATUS_OKAY(KP_INST) DT_INST_FOREACH_STATUS_OKAY(KP_INST)

4
app/src/behaviors/behavior_to_layer.c

@ -37,7 +37,7 @@ static const struct behavior_driver_api behavior_to_driver_api = {
.binding_released = to_keymap_binding_released, .binding_released = to_keymap_binding_released,
}; };
DEVICE_AND_API_INIT(behavior_to, DT_INST_LABEL(0), behavior_to_init, NULL, NULL, APPLICATION, DEVICE_DT_INST_DEFINE(0, behavior_to_init, device_pm_control_nop, NULL, NULL, APPLICATION,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_to_driver_api); CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_to_driver_api);
#endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */ #endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */

6
app/src/behaviors/behavior_toggle_layer.c

@ -43,8 +43,8 @@ static const struct behavior_tog_config behavior_tog_config = {};
static struct behavior_tog_data behavior_tog_data; static struct behavior_tog_data behavior_tog_data;
DEVICE_AND_API_INIT(behavior_tog, DT_INST_LABEL(0), behavior_tog_init, &behavior_tog_data, DEVICE_DT_INST_DEFINE(0, behavior_tog_init, device_pm_control_nop, &behavior_tog_data,
&behavior_tog_config, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_tog_config, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&behavior_tog_driver_api); &behavior_tog_driver_api);
#endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */ #endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */

7
app/src/behaviors/behavior_transparent.c

@ -34,8 +34,7 @@ static const struct behavior_driver_api behavior_transparent_driver_api = {
.binding_released = on_keymap_binding_released, .binding_released = on_keymap_binding_released,
}; };
DEVICE_AND_API_INIT(behavior_transparent, DT_INST_LABEL(0), behavior_transparent_init, NULL, NULL, DEVICE_DT_INST_DEFINE(0, behavior_transparent_init, device_pm_control_nop, NULL, NULL, APPLICATION,
APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_transparent_driver_api);
&behavior_transparent_driver_api);
#endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */ #endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */

10
app/src/ext_power_generic.c

@ -231,13 +231,7 @@ static const struct ext_power_api api = {.enable = ext_power_generic_enable,
#define ZMK_EXT_POWER_INIT_PRIORITY 81 #define ZMK_EXT_POWER_INIT_PRIORITY 81
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT DEVICE_DT_INST_DEFINE(0, ext_power_generic_init, &ext_power_generic_pm_control, &data, &config,
DEVICE_DEFINE(ext_power_generic, DT_INST_LABEL(0), ext_power_generic_init, POST_KERNEL, ZMK_EXT_POWER_INIT_PRIORITY, &api);
&ext_power_generic_pm_control, &data, &config, POST_KERNEL,
ZMK_EXT_POWER_INIT_PRIORITY, &api);
#else
DEVICE_AND_API_INIT(ext_power_generic, DT_INST_LABEL(0), ext_power_generic_init, &data, &config,
POST_KERNEL, ZMK_EXT_POWER_INIT_PRIORITY, &api);
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
#endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */ #endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */

Loading…
Cancel
Save