mirror of
https://github.com/mikecarper/MeshCore.git
synced 2026-10-23 13:22:22 +00:00
Update MeshCore features and OTA layout handling
This commit is contained in:
1 parent
e4c8ae5a0b
commit
e742333a0e
74 files changed
+1696
-1169
No files matched your search
@@ -56,6 +56,7 @@ void halt() {
|
||||
}
|
||||
|
||||
static char command[160];
|
||||
static const unsigned long POWERSAVING_FIRST_SLEEP_SECS = 120;
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
@@ -179,4 +180,21 @@ void loop() {
|
||||
#ifdef HAS_EXTERNAL_WATCHDOG
|
||||
external_watchdog.loop();
|
||||
#endif
|
||||
|
||||
if (the_mesh.getNodePrefs()->powersaving_enabled
|
||||
&& !board.isUsbDataConnected()) {
|
||||
uint32_t sleep_secs = the_mesh.getPowerSaveSleepSeconds(30);
|
||||
#ifdef HAS_EXTERNAL_WATCHDOG
|
||||
if (sleep_secs > 0) external_watchdog.feed();
|
||||
#endif
|
||||
#if defined(NRF52_PLATFORM)
|
||||
if (sleep_secs > 0) board.sleep(0);
|
||||
#else
|
||||
if (sleep_secs > 0
|
||||
&& the_mesh.millisHasNowPassed(
|
||||
POWERSAVING_FIRST_SLEEP_SECS * 1000UL)) {
|
||||
board.sleep(sleep_secs);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user