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

@@ -7,16 +7,16 @@
#define BLINK_PERIOD_MS 1000 // LED_PIN blinking period in millis
// This flash space resides at after the 0-wait 320k area
static char *s_flash_space = (char *) (0x8000000 + 320 * 1024);
// static char *s_flash_space = (char *) (0x8000000 + 320 * 1024);
bool web_load_settings(void *buf, size_t len) {
if (*(uint32_t *) s_flash_space != SETTINGS_MAGIC) return false;
memcpy(buf, s_flash_space, len);
return true;
(void) buf, (void) len;
return false;
}
bool web_save_settings(void *buf, size_t len) {
return mg_flash_write(s_flash_space, buf, len);
(void) buf, (void) len;
return true;
}
static void timer_fn(void *arg) {
@@ -2,8 +2,7 @@
// See https://mongoose.ws/documentation/#build-options
#define MG_ARCH MG_ARCH_NEWLIB
#define MG_OTA MG_OTA_FLASH
#define MG_DEVICE MG_DEVICE_CH32V307
#define MG_OTA MG_OTA_CH32V307
#define MG_ENABLE_TCPIP 1
#define MG_ENABLE_CUSTOM_MILLIS 1