From e7ea421c54215d7bc833db9ec0c6f457e0581000 Mon Sep 17 00:00:00 2001 From: "Sergio R. Caprile" Date: Mon, 27 Jan 2025 10:54:29 -0300 Subject: [PATCH] fix outdated mongoose.h --- mongoose.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/mongoose.h b/mongoose.h index 958b5c72..f25d7ad5 100644 --- a/mongoose.h +++ b/mongoose.h @@ -2690,6 +2690,25 @@ bool mg_ota_end(void); // Stop writing +#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 secsz; // Sector 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); + +#endif + + +