Update axp192.cpp
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user