Update espmega_iot_core.cpp
This commit is contained in:
parent
8bd0fb5ecb
commit
d301462298
|
@ -266,7 +266,10 @@ void ota_begin()
|
|||
if (upload.status == UPLOAD_FILE_START)
|
||||
{
|
||||
lcd_send_command("page ota");
|
||||
Serial.println(upload.currentSize);
|
||||
|
||||
String otafiletxt = "Downloading File : " + upload.filename;
|
||||
lcd_send_stop_bit();
|
||||
panel.writeStr("otatxt.txt", otafiletxt);
|
||||
Serial.printf("Update: %s\n", upload.filename.c_str());
|
||||
if (!Update.begin(UPDATE_SIZE_UNKNOWN))
|
||||
|
@ -282,6 +285,15 @@ void ota_begin()
|
|||
panel.writeStr("otatxt.txt", "Update Failed, Rebooting . . .");
|
||||
Update.printError(Serial);
|
||||
}
|
||||
if (upload.currentSize != 0 && upload.totalSize != 0)
|
||||
{
|
||||
lcd_send_stop_bit();
|
||||
uint32_t totalsize_kb = upload.totalSize / 1000;
|
||||
uint32_t upload_pct = 100 * upload.totalSize/1000000;
|
||||
String otafiletxt = "Downloading File : " + upload.filename + " ("+String(totalsize_kb) + "KB)";
|
||||
panel.writeNum("prog.val", upload_pct);
|
||||
panel.writeStr("otatxt.txt", otafiletxt);
|
||||
}
|
||||
}
|
||||
else if (upload.status == UPLOAD_FILE_END)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue