Simplify OTA API

This commit is contained in:
Sergey Lyubka committed 2024-10-22 01:25:19 +01:00
1 parent 8eabf43525
commit 3319ce78d3
7 files changed
+220 -22

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
#include "arch.h"
struct mg_flash {
void *start; // Address at which flash starts
size_t size; // Flash size
size_t align; // Write alignment
bool (*write_fn)(void *, const void *, size_t); // Write function
bool (*swap_fn)(void); // Swap partitions
};
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);