From 1a3588624d9894c0ca215d58ceec637e58c6fa7e Mon Sep 17 00:00:00 2001 From: "Sergio R. Caprile" Date: Tue, 21 Jan 2025 16:50:14 -0300 Subject: [PATCH] update mongoose.h --- mongoose.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/mongoose.h b/mongoose.h index 958b5c72ed..f25d7ad503 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 + + +