Harden nRF52 shutdown and radio recovery
This commit is contained in:
1 parent
86160e9323
commit
308589afa3
20 files changed
+107
-43
No files matched your search
@@ -254,7 +254,16 @@ void setup() {
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!radio_init()) { halt(); }
|
||||
int radioinit_attempts = 0;
|
||||
while (!radio_init()) {
|
||||
++radioinit_attempts;
|
||||
MESH_DEBUG_PRINTLN("Radio init failed! (attempt %d)", radioinit_attempts);
|
||||
if (radioinit_attempts >= 3) {
|
||||
MESH_DEBUG_PRINTLN("Radio init failed 3x - rebooting");
|
||||
board.reboot();
|
||||
}
|
||||
delay(500);
|
||||
}
|
||||
|
||||
fast_rng.begin(radio_driver.getRngSeed());
|
||||
|
||||
|
||||
@@ -78,8 +78,15 @@ void onGetStats(uint32_t* rx, uint32_t* tx, uint32_t* errors) {
|
||||
void setup() {
|
||||
board.begin();
|
||||
|
||||
if (!radio_init()) {
|
||||
halt();
|
||||
int radioinit_attempts = 0;
|
||||
while (!radio_init()) {
|
||||
++radioinit_attempts;
|
||||
MESH_DEBUG_PRINTLN("Radio init failed! (attempt %d)", radioinit_attempts);
|
||||
if (radioinit_attempts >= 3) {
|
||||
MESH_DEBUG_PRINTLN("Radio init failed 3x - rebooting");
|
||||
board.reboot();
|
||||
}
|
||||
delay(500);
|
||||
}
|
||||
|
||||
radio_driver.begin();
|
||||
|
||||
@@ -80,9 +80,15 @@ void setup() {
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!radio_init()) {
|
||||
MESH_DEBUG_PRINTLN("Radio init failed!");
|
||||
halt();
|
||||
int radioinit_attempts = 0;
|
||||
while (!radio_init()) {
|
||||
++radioinit_attempts;
|
||||
MESH_DEBUG_PRINTLN("Radio init failed! (attempt %d)", radioinit_attempts);
|
||||
if (radioinit_attempts >= 3) {
|
||||
MESH_DEBUG_PRINTLN("Radio init failed 3x - rebooting");
|
||||
board.reboot();
|
||||
}
|
||||
delay(500);
|
||||
}
|
||||
|
||||
fast_rng.begin(radio_driver.getRngSeed());
|
||||
|
||||
@@ -48,7 +48,16 @@ void setup() {
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!radio_init()) { halt(); }
|
||||
int radioinit_attempts = 0;
|
||||
while (!radio_init()) {
|
||||
++radioinit_attempts;
|
||||
MESH_DEBUG_PRINTLN("Radio init failed! (attempt %d)", radioinit_attempts);
|
||||
if (radioinit_attempts >= 3) {
|
||||
MESH_DEBUG_PRINTLN("Radio init failed 3x - rebooting");
|
||||
board.reboot();
|
||||
}
|
||||
delay(500);
|
||||
}
|
||||
|
||||
fast_rng.begin(radio_driver.getRngSeed());
|
||||
|
||||
|
||||
@@ -568,7 +568,16 @@ void setup() {
|
||||
external_watchdog.begin();
|
||||
#endif
|
||||
|
||||
if (!radio_init()) { halt(); }
|
||||
int radioinit_attempts = 0;
|
||||
while (!radio_init()) {
|
||||
++radioinit_attempts;
|
||||
MESH_DEBUG_PRINTLN("Radio init failed! (attempt %d)", radioinit_attempts);
|
||||
if (radioinit_attempts >= 3) {
|
||||
MESH_DEBUG_PRINTLN("Radio init failed 3x - rebooting");
|
||||
board.reboot();
|
||||
}
|
||||
delay(500);
|
||||
}
|
||||
|
||||
fast_rng.begin(radio_driver.getRngSeed());
|
||||
|
||||
|
||||
@@ -70,7 +70,16 @@ void setup() {
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!radio_init()) { halt(); }
|
||||
int radioinit_attempts = 0;
|
||||
while (!radio_init()) {
|
||||
++radioinit_attempts;
|
||||
MESH_DEBUG_PRINTLN("Radio init failed! (attempt %d)", radioinit_attempts);
|
||||
if (radioinit_attempts >= 3) {
|
||||
MESH_DEBUG_PRINTLN("Radio init failed 3x - rebooting");
|
||||
board.reboot();
|
||||
}
|
||||
delay(500);
|
||||
}
|
||||
|
||||
fast_rng.begin(radio_driver.getRngSeed());
|
||||
|
||||
|
||||
Reference in new issue
Block a user