From fe779b86318d5cc2c1bc52bd78100f82af9f2f0a Mon Sep 17 00:00:00 2001 From: paulchilton Date: Sat, 31 Dec 2022 20:13:15 +0000 Subject: [PATCH] Update axp192.cpp --- components/axp192/axp192.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/axp192/axp192.cpp b/components/axp192/axp192.cpp index 5dc39df..e1a24c2 100644 --- a/components/axp192/axp192.cpp +++ b/components/axp192/axp192.cpp @@ -117,9 +117,13 @@ void AXP192Component::begin(bool disableLDO2, bool disableLDO3, bool disableRTC, // Enable bat detection Write1Byte(0x32, 0x46); + ESP_LOGD(TAG, GetStartupReason()); + // If we're waking from a cold boot, initialise power chip if (GetStartupReason() == "ESP_RST_POWERON") { + ESP_LOGD(TAG, "First power on, restarting ESP..."); + // Reboot the ESP with the axp initialised ESP.restart(); }