summaryrefslogtreecommitdiff
path: root/apps/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/main.c')
-rw-r--r--apps/main.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/apps/main.c b/apps/main.c
index 5715057ee2..9846f116be 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -506,7 +506,12 @@ static void init(void)
506 506
507 button_init(); 507 button_init();
508 508
509 /* Don't initialize power management here if it could incorrectly
510 * measure battery voltage, and it's not needed for charging. */
511#if !defined(NEED_ATA_POWER_BATT_MEASURE) || \
512 (CONFIG_CHARGING > CHARGING_MONITOR)
509 powermgmt_init(); 513 powermgmt_init();
514#endif
510 515
511#if CONFIG_TUNER 516#if CONFIG_TUNER
512 radio_init(); 517 radio_init();
@@ -567,6 +572,12 @@ static void init(void)
567 panicf("ata: %d", rc); 572 panicf("ata: %d", rc);
568 } 573 }
569 574
575#if defined(NEED_ATA_POWER_BATT_MEASURE) && \
576 (CONFIG_CHARGING <= CHARGING_MONITOR)
577 /* After storage_init(), ATA power must be on, so battery voltage
578 * can be measured. Initialize power management if it was delayed. */
579 powermgmt_init();
580#endif
570#ifdef HAVE_EEPROM_SETTINGS 581#ifdef HAVE_EEPROM_SETTINGS
571 CHART(">eeprom_settings_init"); 582 CHART(">eeprom_settings_init");
572 eeprom_settings_init(); 583 eeprom_settings_init();