Allow safe nRF52 MCU idle between radio2 scan deadlines
This commit is contained in:
1 parent
53835c0793
commit
f1d281a766
30 files changed
+916
-24
No files matched your search
@@ -367,6 +367,10 @@ void loop() {
|
||||
#ifdef HAS_EXTERNAL_WATCHDOG
|
||||
external_watchdog.loop();
|
||||
#endif
|
||||
#if defined(NRF52_PLATFORM)
|
||||
if ((the_mesh.getNodePrefs()->powersaving_enabled || the_mesh.isTrackerModeEnabled())
|
||||
&& the_mesh.isDualRadioActive() && !morse_timing) board.prepareProfileIdleCycle();
|
||||
#endif
|
||||
|
||||
const auto sleep_guard = [](bool allowed, mesh::powerdiag::Reason reason) {
|
||||
if (!allowed && mesh::powerdiag::enabled())
|
||||
@@ -397,12 +401,15 @@ void loop() {
|
||||
if (sleep_ms > 0) external_watchdog.feed();
|
||||
#endif
|
||||
#if defined(NRF52_PLATFORM)
|
||||
if (sleep_ms > 0) {
|
||||
if (sleep_ms > 0 && the_mesh.canIdleDualRadio()) {
|
||||
#if MESH_ENABLE_SENSOR_TRACKER
|
||||
if (!the_mesh.isTrackerModeEnabled() || armTrackerSleepWake(mesh::power::powerSaveSleepSeconds(sleep_ms))) {
|
||||
if (mesh::powerdiag::enabled()) mesh::powerdiag::decision(0, millis());
|
||||
if (noise_floor_wait) board.sleepMilliseconds(sleep_ms);
|
||||
else board.sleep(0);
|
||||
// Timer setup can schedule another task or consume the scan guard.
|
||||
if (the_mesh.canIdleDualRadio()) {
|
||||
if (mesh::powerdiag::enabled()) mesh::powerdiag::decision(0, millis());
|
||||
if (noise_floor_wait) board.sleepMilliseconds(sleep_ms);
|
||||
else board.sleep(0);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (mesh::powerdiag::enabled())
|
||||
|
||||
Reference in new issue
Block a user