Commonise flash-based OTA. Add h7 support.

This commit is contained in:
cpq committed 2023-09-24 21:55:49 +01:00
1 parent 6e648c90b0
commit b37efbe891
22 files changed
+2069 -1173

No files matched your search

+18 -15
View File
@@ -2,36 +2,39 @@
#include "ota.h"
#if MG_OTA == MG_OTA_NONE
static struct mg_ota_data s_od[2] = {
{MG_OTA_MAGIC, (uint32_t) -1, (uint32_t) -1, (uint32_t) -1, (uint32_t) -1,
(uint32_t) -1},
{MG_OTA_MAGIC, (uint32_t) -1, (uint32_t) -1, (uint32_t) -1, (uint32_t) -1,
(uint32_t) -1},
};
bool mg_ota_begin(size_t new_firmware_size) {
MG_DEBUG(("Starting firmware update, size %lu", new_firmware_size));
(void) new_firmware_size;
return true;
}
bool mg_ota_write(const void *buf, size_t len) {
MG_DEBUG(("%p %lu", buf, len));
(void) buf, (void) len;
return true;
}
bool mg_ota_end(void) {
return true;
}
bool mg_ota_status(struct mg_ota_data od[2]) {
od[0] = s_od[0];
od[1] = s_od[1];
return true;
}
bool mg_ota_commit(void) {
s_od[0].golden = 0;
return true;
}
bool mg_ota_rollback(void) {
return true;
}
int mg_ota_status(int fw) {
(void) fw;
return 0;
}
uint32_t mg_ota_crc32(int fw) {
(void) fw;
return 0;
}
uint32_t mg_ota_timestamp(int fw) {
(void) fw;
return 0;
}
size_t mg_ota_size(int fw) {
(void) fw;
return 0;
}
void mg_sys_reset(void) {
MG_DEBUG(("Resetting device..."));
}
#endif