From dbb07fd30ca50150d808125d49e015667c200ce0 Mon Sep 17 00:00:00 2001 From: Peter Johanson Date: Thu, 4 Jul 2024 18:26:27 +0000 Subject: [PATCH] fix: Fix external power settings load issue. * Because settings load is delayed now, enable external power on init, and let it be disabled on settings load later, to ensure power is on early for other peripheral initialization. Fixes: #2361 --- app/src/ext_power_generic.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/ext_power_generic.c b/app/src/ext_power_generic.c index 5a9cc5b86a9..17b3ba64026 100644 --- a/app/src/ext_power_generic.c +++ b/app/src/ext_power_generic.c @@ -151,11 +151,11 @@ static int ext_power_generic_init(const struct device *dev) { #if IS_ENABLED(CONFIG_SETTINGS) k_work_init_delayable(&ext_power_save_work, ext_power_save_state_work); -#else - // Default to the ext_power being open when no settings - ext_power_enable(dev); #endif + // Enable by default. We may get disabled again once settings load. + ext_power_enable(dev); + if (config->init_delay_ms) { k_msleep(config->init_delay_ms); }