mirror of
https://github.com/m5stack/StackChan.git
synced 2026-04-27 19:12:40 +00:00
update firmware v1.2.4 (#16)
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include <hal/hal.h>
|
||||
#include <functional>
|
||||
#include <vector>
|
||||
#include <apps/common/loading_page/loading_page.h>
|
||||
|
||||
using namespace uitk;
|
||||
using namespace uitk::lvgl_cpp;
|
||||
@@ -294,3 +295,35 @@ void FwVersionWorker::update()
|
||||
_egg->update();
|
||||
}
|
||||
}
|
||||
|
||||
SystemUpdateWorker::SystemUpdateWorker()
|
||||
{
|
||||
auto loading_page = std::make_unique<view::LoadingPage>(0xF6F6F6, 0x26206A);
|
||||
GetHAL().lvglUnlock();
|
||||
|
||||
// Start network
|
||||
GetHAL().startNetwork([&](std::string_view msg) {
|
||||
LvglLockGuard lock;
|
||||
loading_page->setMessage(msg);
|
||||
});
|
||||
|
||||
// Update Firmware
|
||||
bool result = GetHAL().updateFirmware([&](std::string_view msg) {
|
||||
LvglLockGuard lock;
|
||||
loading_page->setMessage(msg);
|
||||
});
|
||||
|
||||
// Hold the result for a while
|
||||
GetHAL().delay(3000);
|
||||
|
||||
GetHAL().lvglLock();
|
||||
_is_done = true;
|
||||
}
|
||||
|
||||
SystemUpdateWorker::~SystemUpdateWorker()
|
||||
{
|
||||
}
|
||||
|
||||
void SystemUpdateWorker::update()
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user