mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-21 11:30:01 +00:00
Add MG_OTA_{ROLLBACK,STATE_SET,STATE_GET}
This commit is contained in:
1 parent
a6452f5311
commit
67f249c58a
16 files changed
+345
-131
No files matched your search
+2
-1
@@ -27,7 +27,7 @@ bool mg_ota_flash_begin(size_t new_firmware_size, struct mg_flash *flash) {
|
||||
s_size = new_firmware_size;
|
||||
MG_INFO(("Starting OTA, firmware size %lu", s_size));
|
||||
} else {
|
||||
MG_ERROR(("Firmware %lu is too big to fit %lu", new_firmware_size, half));
|
||||
MG_ERROR(("Firmware %lu is too big to fit %lu", new_firmware_size, half - flash->align));
|
||||
}
|
||||
}
|
||||
return ok;
|
||||
@@ -76,6 +76,7 @@ bool mg_ota_flash_end(struct mg_flash *flash) {
|
||||
}
|
||||
#endif
|
||||
s_size = 0;
|
||||
if (ok) MG_OTA_STATE_SET(MG_OTA_TESTING);
|
||||
if (ok) ok = flash->swap_fn();
|
||||
}
|
||||
MG_INFO(("Finishing OTA: %s", ok ? "ok" : "fail"));
|
||||
|
||||
Reference in new issue
Block a user