Add an hourly emergency battery sleep schedule for infrastructure nodes
This commit is contained in:
1 parent
744692fb93
commit
0c7dec9f19
30 files changed
+2020
-33
No files matched your search
@@ -20,6 +20,7 @@
|
||||
#include <helpers/HostKiss.h>
|
||||
#include <helpers/MorseLoopPolicy.h>
|
||||
#include <helpers/PowerManagementUtils.h>
|
||||
#include <helpers/EmergencyPowerRuntime.h>
|
||||
#if MESH_PACKET_LOGGING
|
||||
#include <helpers/SerialPacketLog.h>
|
||||
#endif
|
||||
@@ -452,6 +453,28 @@ void loop() {
|
||||
}
|
||||
#endif
|
||||
|
||||
mesh::power::serviceRegulatorSettings();
|
||||
#if defined(MESH_SOLARXIAO_POWER) && MESH_SOLARXIAO_POWER
|
||||
mesh::solar::service();
|
||||
#endif
|
||||
board.loop();
|
||||
|
||||
#if MESH_ENABLE_EMERGENCY_POWER
|
||||
static mesh::power::EmergencyPowerRuntime emergency_power;
|
||||
#if defined(ESP32_PLATFORM)
|
||||
board.servicePowerTestControls();
|
||||
#endif
|
||||
rtc_clock.tick();
|
||||
#ifdef HAS_EXTERNAL_WATCHDOG
|
||||
external_watchdog.loop();
|
||||
#endif
|
||||
bool emergency_busy = command[0];
|
||||
#if MESH_USB_CONSOLE_COOPERATIVE
|
||||
emergency_busy = emergency_busy || the_mesh.hasPendingSerialOutput();
|
||||
#endif
|
||||
if (emergency_power.service(the_mesh, radio_driver, board,
|
||||
the_mesh.getPowerCLI(), emergency_busy, the_mesh.emergencyPowerBusy())) return;
|
||||
#endif
|
||||
the_mesh.loop();
|
||||
const bool morse_timing = mesh::morseTimingActive(&radio_driver);
|
||||
#if defined(USE_LR2021)
|
||||
@@ -466,11 +489,6 @@ void loop() {
|
||||
#endif
|
||||
#endif
|
||||
rtc_clock.tick();
|
||||
mesh::power::serviceRegulatorSettings();
|
||||
#if defined(MESH_SOLARXIAO_POWER) && MESH_SOLARXIAO_POWER
|
||||
mesh::solar::service();
|
||||
#endif
|
||||
board.loop();
|
||||
if (mesh::serviceUsbLoggingWatchdog(usbLoggingRecoverySafe)) board.reboot();
|
||||
#if MESH_USB_CONSOLE_COOPERATIVE
|
||||
#if MESH_ENABLE_HOST_KISS
|
||||
@@ -489,7 +507,9 @@ void loop() {
|
||||
&& !morse_timing) board.prepareProfileIdleCycle();
|
||||
#endif
|
||||
#if defined(ESP32_PLATFORM)
|
||||
#if !MESH_ENABLE_EMERGENCY_POWER
|
||||
board.servicePowerTestControls();
|
||||
#endif
|
||||
mesh::esp32::serviceCpuFrequencyPolicy(board, the_mesh.getNodePrefs()->cpu_freq_mhz,
|
||||
the_mesh.getNodePrefs()->powersaving_enabled != 0, millis(), false, the_mesh.isDualRadioActive());
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user