Moved restart code to the correct place for the M5Tough
This commit is contained in:
@@ -22,6 +22,15 @@ void AXP192Component::setup()
|
|||||||
case AXP192_M5TOUGH:
|
case AXP192_M5TOUGH:
|
||||||
{
|
{
|
||||||
begin(false, false, false, false, false);
|
begin(false, false, false, false, false);
|
||||||
|
|
||||||
|
// If we're waking from a cold boot
|
||||||
|
if (GetStartupReason() == "ESP_RST_POWERON")
|
||||||
|
{
|
||||||
|
ESP_LOGD(TAG, "First power on, restarting ESP...");
|
||||||
|
|
||||||
|
// Reboot the ESP with the axp initialised
|
||||||
|
ESP.restart();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -50,15 +59,6 @@ void AXP192Component::update() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
UpdateBrightness();
|
UpdateBrightness();
|
||||||
|
|
||||||
// If we're waking from a cold boot
|
|
||||||
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