From 39a69b86c30ef76ca04970f2401a680acb644df8 Mon Sep 17 00:00:00 2001 From: AtlavoxDev Date: Mon, 25 May 2026 09:04:47 -0400 Subject: [PATCH] Add MainBoard::bootComplete() hook for boot-indicator LED feedback Framework for upcoming variant-specific PRs that add LED feedback during boot. The hook gives users visual cues that the device is busy and shouldn't be interacted with until startup completes. --- examples/companion_radio/main.cpp | 2 ++ examples/kiss_modem/main.cpp | 2 ++ examples/simple_repeater/main.cpp | 2 ++ examples/simple_room_server/main.cpp | 2 ++ src/MeshCore.h | 4 ++++ 5 files changed, 12 insertions(+) diff --git a/examples/companion_radio/main.cpp b/examples/companion_radio/main.cpp index 4395c5b3..0eb6b11b 100644 --- a/examples/companion_radio/main.cpp +++ b/examples/companion_radio/main.cpp @@ -238,6 +238,8 @@ void setup() { #ifdef DISPLAY_CLASS ui_task.begin(disp, &sensors, the_mesh.getNodePrefs()); // still want to pass this in as dependency, as prefs might be moved #endif + + board.bootComplete(); } void loop() { diff --git a/examples/kiss_modem/main.cpp b/examples/kiss_modem/main.cpp index e497aa98..d3ba43b2 100644 --- a/examples/kiss_modem/main.cpp +++ b/examples/kiss_modem/main.cpp @@ -119,6 +119,8 @@ void setup() { modem->setGetCurrentRssiCallback(onGetCurrentRssi); modem->setGetStatsCallback(onGetStats); modem->begin(); + + board.bootComplete(); } void loop() { diff --git a/examples/simple_repeater/main.cpp b/examples/simple_repeater/main.cpp index 7fad801b..52049df3 100644 --- a/examples/simple_repeater/main.cpp +++ b/examples/simple_repeater/main.cpp @@ -103,6 +103,8 @@ void setup() { #if ENABLE_ADVERT_ON_BOOT == 1 the_mesh.sendSelfAdvertisement(16000, false); #endif + + board.bootComplete(); } void loop() { diff --git a/examples/simple_room_server/main.cpp b/examples/simple_room_server/main.cpp index de38c253..79999436 100644 --- a/examples/simple_room_server/main.cpp +++ b/examples/simple_room_server/main.cpp @@ -80,6 +80,8 @@ void setup() { #if ENABLE_ADVERT_ON_BOOT == 1 the_mesh.sendSelfAdvertisement(16000, false); #endif + + board.bootComplete(); } void loop() { diff --git a/src/MeshCore.h b/src/MeshCore.h index 2db1d4c3..6c3c7318 100644 --- a/src/MeshCore.h +++ b/src/MeshCore.h @@ -52,6 +52,10 @@ public: virtual void onAfterTransmit() { } virtual void reboot() = 0; virtual void powerOff() { /* no op */ } + // Called by example setup() functions to signal that boot is complete. + // Boards may override to stop a boot-indicator LED sequence or similar. + // Default no-op: boards that don't care need not implement anything. + virtual void bootComplete() { /* no op */ } virtual void sleep(uint32_t secs) { /* no op */ } virtual uint32_t getGpio() { return 0; } virtual void setGpio(uint32_t values) {}