Browse Source

fix(ext-power): Initialize as soon as settings are available

xmkb
Nick Winans 4 years ago committed by Pete Johanson
parent
commit
b43fb8502e
  1. 8
      app/src/ext_power_generic.c

8
app/src/ext_power_generic.c

@ -223,13 +223,15 @@ static const struct ext_power_api api = {.enable = ext_power_generic_enable,
.disable = ext_power_generic_disable, .disable = ext_power_generic_disable,
.get = ext_power_generic_get}; .get = ext_power_generic_get};
#define ZMK_EXT_POWER_INIT_PRIORITY 81
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT #ifdef CONFIG_DEVICE_POWER_MANAGEMENT
DEVICE_DEFINE(ext_power_generic, DT_INST_LABEL(0), ext_power_generic_init, DEVICE_DEFINE(ext_power_generic, DT_INST_LABEL(0), ext_power_generic_init,
&ext_power_generic_pm_control, &data, &config, APPLICATION, &ext_power_generic_pm_control, &data, &config, POST_KERNEL,
CONFIG_APPLICATION_INIT_PRIORITY, &api); ZMK_EXT_POWER_INIT_PRIORITY, &api);
#else #else
DEVICE_AND_API_INIT(ext_power_generic, DT_INST_LABEL(0), ext_power_generic_init, &data, &config, DEVICE_AND_API_INIT(ext_power_generic, DT_INST_LABEL(0), ext_power_generic_init, &data, &config,
APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY, &api); POST_KERNEL, ZMK_EXT_POWER_INIT_PRIORITY, &api);
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */ #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