feat: OTA über HTTP mit Trailer-Prüfung

This commit is contained in:
Michael Sauer
2026-09-12 01:36:57 +02:00
parent ebee9e8e61
commit aa8151c3d6
8 changed files with 146 additions and 19 deletions
+10
View File
@@ -20,6 +20,7 @@
#include "sys/nl_app.h"
#include "sys/nl_app_api.h"
#include "sys/nl_console.h"
#include "sys/nl_ota.h"
#include "nl_version.h"
@@ -163,6 +164,14 @@ static void app_task(void *arg)
nl_state_log_init(base + NL_FL_STATE_0, base + NL_FL_STATE_1);
have_last = nl_state_log_load(&last);
store_unlock();
if (s_settings.ota_pending) {
/* We came back from an update attempt: restore the light the user had on. */
s_settings.ota_pending = 0;
printf("boot after ota attempt\r\n");
store_lock();
(void)nl_settings_save(&s_settings);
store_unlock();
}
printf("boot #%u, settings: pob=%u fade=%u/%u, last state: %s\r\n", boots,
s_settings.power_on_behaviour, s_settings.fade_in_ms, s_settings.fade_out_ms,
have_last ? "yes" : "no");
@@ -184,6 +193,7 @@ static void app_task(void *arg)
nl_app_factory_reset(); /* does not return */
tls_watchdog_init(20u * 1000u * 1000u); /* 20 s */
nl_ota_init();
nl_console_start();
{