mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
Modified hasPendingWork to return bool
This commit is contained in:
parent
5c6c15942b
commit
1706f759b7
3 changed files with 6 additions and 6 deletions
|
|
@ -127,7 +127,7 @@ void loop() {
|
|||
|
||||
if (the_mesh.getNodePrefs()->powersaving_enabled && // To check if power saving is enabled
|
||||
the_mesh.millisHasNowPassed(lastActive + nextSleepinSecs * 1000)) { // To check if it is time to sleep
|
||||
if (the_mesh.hasPendingWork() == 0) { // No pending work. Safe to sleep
|
||||
if (!the_mesh.hasPendingWork()) { // No pending work. Safe to sleep
|
||||
board.sleep(1800); // To sleep. Wake up after 30 minutes or when receiving a LoRa packet
|
||||
lastActive = millis();
|
||||
nextSleepinSecs = 5; // Default: To work for 5s and sleep again
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue