Skip to content

Commit 25f8c8e

Browse files
committed
Set interval when no service does it.
1 parent d1137d8 commit 25f8c8e

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

esp32/modules/services.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,10 @@ def loop_timer_callback(tmr):
168168
loopCallbacks = newLoopCallbacks
169169
del(newLoopCallbacks)
170170

171+
if requestedInterval>=99999999:
172+
print("[SERVICES] No loop interval returned.")
173+
requestedInterval = -1
174+
171175
try:
172176
if pmCallback(requestedInterval):
173177
print("[SERVICES] Loop timer (re-)started")
@@ -204,7 +208,11 @@ def draw_timer_callback(tmr):
204208

205209
badge.eink_busy_wait()
206210

207-
if len(drawCallbacks)>0:
211+
if requestedInterval>=99999999:
212+
print("[SERVICES] No draw interval returned.")
213+
requestedInterval = -1
214+
215+
if len(drawCallbacks)>0 and requestedInterval>=0:
208216
print("[SERVICES] New draw requested in "+str(requestedInterval)+".")
209217
tmr.init(period=requestedInterval*1000, mode=machine.Timer.ONE_SHOT, callback=draw_timer_callback)
210218

esp32/modules/splash.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ def power_countdown_callback(tmr):
5656
global requestedStandbyTime
5757
if requestedStandbyTime>0:
5858
if enableBpp:
59-
print("[PM] BPP for "+str(round(requestedStandbyTime/60))+" minutes.")
59+
print("[PM] BPP for "+str(requestedStandbyTime)+" seconds.")
6060
#appglue.start_bpp(round(requestedStandbyTime/60)) #BPP needs time in minutes
61-
deepsleep.start_sleeping(requestedStandbyTime*1000)
61+
deepsleep.start_sleeping(requestedStandbyTime)
6262
else:
6363
print("[PM] Sleep for "+str(round())+" seconds.")
64-
deepsleep.start_sleeping(requestedStandbyTime*1000) #Sleep needs time in milliseconds
64+
deepsleep.start_sleeping(requestedStandbyTime)
6565
else:
6666
print("[PM] BPP forever.")
6767
#appglue.start_bpp(-1)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy