Skip to content

Commit d2c2a6e

Browse files
authored
Merge pull request meshcore-dev#2621 from AtlavoxDev/feature/mainboard-boot-complete-hook
Feature/mainboard boot complete hook
2 parents 7227871 + e5dab6b commit d2c2a6e

5 files changed

Lines changed: 12 additions & 0 deletions

File tree

examples/companion_radio/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,8 @@ void setup() {
238238
#ifdef DISPLAY_CLASS
239239
ui_task.begin(disp, &sensors, the_mesh.getNodePrefs()); // still want to pass this in as dependency, as prefs might be moved
240240
#endif
241+
242+
board.onBootComplete();
241243
}
242244

243245
void loop() {

examples/kiss_modem/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ void setup() {
119119
modem->setGetCurrentRssiCallback(onGetCurrentRssi);
120120
modem->setGetStatsCallback(onGetStats);
121121
modem->begin();
122+
123+
board.onBootComplete();
122124
}
123125

124126
void loop() {

examples/simple_repeater/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ void setup() {
103103
#if ENABLE_ADVERT_ON_BOOT == 1
104104
the_mesh.sendSelfAdvertisement(16000, false);
105105
#endif
106+
107+
board.onBootComplete();
106108
}
107109

108110
void loop() {

examples/simple_room_server/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ void setup() {
8080
#if ENABLE_ADVERT_ON_BOOT == 1
8181
the_mesh.sendSelfAdvertisement(16000, false);
8282
#endif
83+
84+
board.onBootComplete();
8385
}
8486

8587
void loop() {

src/MeshCore.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ class MainBoard {
5252
virtual void onAfterTransmit() { }
5353
virtual void reboot() = 0;
5454
virtual void powerOff() { /* no op */ }
55+
// Called by example setup() functions to signal that boot is complete.
56+
// Boards may override to stop a boot-indicator LED sequence or similar.
57+
// Default no-op: boards that don't care need not implement anything.
58+
virtual void onBootComplete() { /* no op */ }
5559
virtual void sleep(uint32_t secs) { /* no op */ }
5660
virtual uint32_t getGpio() { return 0; }
5761
virtual void setGpio(uint32_t values) {}

0 commit comments

Comments
 (0)