mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-07-29 08:27:17 +02:00
Move rebooting process out of OtaHandler
This commit is contained in:
@ -41,16 +41,13 @@ public:
|
||||
OtaUpdateOutcome ret = attemptToPerformOta(&config);
|
||||
Serial.println(ret);
|
||||
if (ret == OtaUpdateOutcome::UPDATE_PERFORMED) {
|
||||
Serial.println("OTA update performed, restarting ...");
|
||||
int i = 6;
|
||||
while (i != 0) {
|
||||
i = i - 1;
|
||||
if (this->callback) {
|
||||
this->callback(OtaState::OTA_STATE_SUCCESS, String(i));
|
||||
}
|
||||
delay(1000);
|
||||
if (this->callback) {
|
||||
this->callback(OtaState::OTA_STATE_SUCCESS, "");
|
||||
}
|
||||
} else {
|
||||
if(this->callback) {
|
||||
this->callback(OtaState::OTA_STATE_FAIL, "");
|
||||
}
|
||||
esp_restart();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user