mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-09 01:09:51 +03:00
show progress bar when automatically installing firmware
This commit is contained in:
@@ -2061,7 +2061,12 @@ bool System::uploadFirmwareURL(const char * url) {
|
||||
|
||||
// we're about to start the upload, set the status so the Web System Monitor spots it
|
||||
EMSESP::system_.systemStatus(SYSTEM_STATUS::SYSTEM_STATUS_UPLOADING);
|
||||
// TODO do we need to stop the UART with EMSuart::stop() ?
|
||||
// TODO do we need to stop the UART first with EMSuart::stop() ?
|
||||
|
||||
// set a callback so we can monitor progress in the WebUI
|
||||
Update.onProgress([](size_t progress, size_t total) {
|
||||
EMSESP::system_.systemStatus(SYSTEM_STATUS::SYSTEM_STATUS_UPLOADING+(progress * 100 / total));
|
||||
});
|
||||
|
||||
// get tcp stream and send it to Updater
|
||||
WiFiClient * stream = http.getStreamPtr();
|
||||
|
||||
@@ -62,7 +62,7 @@ enum PHY_type : uint8_t { PHY_TYPE_NONE = 0, PHY_TYPE_LAN8720, PHY_TYPE_TLK110 }
|
||||
enum SYSTEM_STATUS : uint8_t {
|
||||
SYSTEM_STATUS_NORMAL = 0,
|
||||
SYSTEM_STATUS_PENDING_UPLOAD = 1,
|
||||
SYSTEM_STATUS_UPLOADING = 2,
|
||||
SYSTEM_STATUS_UPLOADING = 100,
|
||||
SYSTEM_STATUS_ERROR_UPLOAD = 3,
|
||||
SYSTEM_STATUS_PENDING_RESTART = 4,
|
||||
SYSTEM_STATUS_RESTART_REQUESTED = 5
|
||||
|
||||
Reference in New Issue
Block a user