Refactor OTA API

This commit is contained in:
Sergio R. Caprile committed 2024-10-24 19:08:06 -03:00
1 parent 3319ce78d3
commit 9b99f62311
27 files changed
+1716 -2143

No files matched your search

+9 -3
View File
@@ -1,9 +1,13 @@
#include "arch.h"
#include "ota.h"
#if MG_OTA != MG_OTA_NONE && MG_OTA != MG_OTA_CUSTOM
struct mg_flash {
void *start; // Address at which flash starts
size_t size; // Flash size
size_t align; // Write alignment
void *start; // Address at which flash starts
size_t size; // Flash size
size_t secsz; // Sector size
size_t align; // Write alignment
bool (*write_fn)(void *, const void *, size_t); // Write function
bool (*swap_fn)(void); // Swap partitions
};
@@ -11,3 +15,5 @@ struct mg_flash {
bool mg_ota_flash_begin(size_t new_firmware_size, struct mg_flash *flash);
bool mg_ota_flash_write(const void *buf, size_t len, struct mg_flash *flash);
bool mg_ota_flash_end(struct mg_flash *flash);
#endif