fix #123 - No autoforward after initiated update

This commit is contained in:
regevbr
2023-03-14 15:49:03 +02:00
parent 8e6fa00bb6
commit f48773d34d
4 changed files with 47 additions and 7 deletions

14
Ota.cpp
View File

@@ -26,8 +26,7 @@ void Ota::updateFirmware(uint8_t* buf, size_t size)
Log->println("EndOTA");
if (ESP_OK == esp_ota_set_boot_partition(esp_ota_get_next_update_partition(NULL)))
{
delay(2000);
restartEsp(RestartReason::OTACompleted);
_updateCompleted = true;
}
else
{
@@ -40,3 +39,14 @@ bool Ota::updateStarted()
{
return _updateStarted;
}
bool Ota::updateCompleted()
{
return _updateCompleted;
}
bool Ota::restart()
{
_updateCompleted = false;
_updateStarted = false;
}