process to asinc

This commit is contained in:
Dmitry Borisenko
2020-08-25 18:36:05 +03:00
parent b1318de1dc
commit 532925756f
14 changed files with 382 additions and 388 deletions

View File

@@ -1,5 +1,5 @@
#include "Upgrade.h"
#include "Class/NotAsinc.h"
#include "Global.h"
#include "ESP8266.h"
@@ -27,7 +27,14 @@ void getLastVersion() {
}
}
void initUpdater() {
void upgradeInit() {
myNotAsincActions->add(
do_UPGRADE, [&](void*) {
upgrade_firmware();
},
nullptr);
if (isNetworkActive()) {
getLastVersion();
if (lastVersion.length()) {
@@ -78,10 +85,3 @@ void upgrade_firmware() {
pm.error("on firmware");
}
}
void do_update() {
if (updateFlag) {
updateFlag = false;
upgrade_firmware();
}
}