simple_sensor: dfu, radio silence watchdog and get boot via shared NodeMaintenance

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
tthandClaude Opus 5.5 committed 2026-11-04 00:21:54 +01:00
1 parent 278c1b8c8a
commit 7159a00f05
4 files changed
+305 -1

No files matched your search

+8
View File
@@ -1,4 +1,8 @@
#include "SensorMesh.h"
#include <helpers/NodeMaintenance.h>
// CUSTOM (TeTeHacko): dfu, radio silence watchdog, reset reason -- see NodeMaintenance.h.
static NodeMaintenance maint(board, radio_driver);
#ifdef DISPLAY_CLASS
#include "UITask.h"
@@ -32,6 +36,7 @@ protected:
}
bool handleCustomCommand(uint32_t sender_timestamp, char* command, char* reply) override {
if (maint.handleCommand(sender_timestamp, command, reply)) return true;
if (strcmp(command, "magic") == 0) { // example 'custom' command handling
strcpy(reply, "**Magic now done**");
return true; // handled
@@ -57,6 +62,7 @@ void setup() {
delay(1000);
board.begin();
maint.printBootDiag();
#ifdef HAS_EXTERNAL_WATCHDOG
external_watchdog.begin();
@@ -109,6 +115,7 @@ void setup() {
sensors.begin();
the_mesh.begin(fs);
maint.begin(fs, the_mesh.getNodePrefs(), &the_mesh);
#ifdef DISPLAY_CLASS
ui_task.begin(the_mesh.getNodePrefs(), FIRMWARE_BUILD_DATE, FIRMWARE_VERSION);
@@ -156,6 +163,7 @@ void loop() {
board.loop(); // let the board feed its watchdog, run periodic housekeeping
the_mesh.loop();
maint.loop();
sensors.loop();
#ifdef DISPLAY_CLASS
ui_task.loop();