From 93e194506f94acbda6f35e1a8f9dcd9d00ca58a4 Mon Sep 17 00:00:00 2001 From: cyberman54 Date: Wed, 16 Dec 2020 18:54:23 +0100 Subject: [PATCH] PR #683 /2 --- src/power.cpp | 6 +++--- src/reset.cpp | 4 ---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/power.cpp b/src/power.cpp index a813eb60..3dee573c 100644 --- a/src/power.cpp +++ b/src/power.cpp @@ -140,9 +140,6 @@ void AXP192_init(void) { pmu.adc1Enable(AXP202_VBUS_VOL_ADC1, true); pmu.adc1Enable(AXP202_VBUS_CUR_ADC1, true); - // switch power rails on - AXP192_power(pmu_power_on); - #ifdef PMU_INT pinMode(PMU_INT, INPUT_PULLUP); attachInterrupt(digitalPinToInterrupt(PMU_INT), PMUIRQ, FALLING); @@ -161,6 +158,9 @@ void AXP192_init(void) { pmu.enableChargeing(true); #endif + // switch power rails on + AXP192_power(pmu_power_on); + ESP_LOGI(TAG, "AXP192 PMU initialized"); } } diff --git a/src/reset.cpp b/src/reset.cpp index 00668e0b..f740d002 100644 --- a/src/reset.cpp +++ b/src/reset.cpp @@ -51,10 +51,6 @@ void do_after_reset(void) { ESP_LOGI(TAG, "Time spent in deep sleep: %d ms", sleep_time_ms); RTC_runmode = RUNMODE_WAKEUP; -// power on all rails if has PMU -#ifdef HAS_PMU - AXP192_power(pmu_power_on); -#endif break; case ESP_SLEEP_WAKEUP_ALL: