Skip to content
This repository was archived by the owner on Oct 28, 2023. It is now read-only.

Commit 6ac2910

Browse files
authored
Merge pull request SHA2017-badge#165 from SHA2017-badge/services-interval-in-ms
Add nice change by raboof
2 parents 2e61a7d + 59af7a7 commit 6ac2910

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

esp32/modules/services.py

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Authors: Renze Nicolai <renze@rnplus.nl>
77
# Thomas Roos <?>
88

9-
import uos, ujson, easywifi, easyrtc, time, appglue, deepsleep, ugfx, badge, machine
9+
import uos, ujson, easywifi, easyrtc, time, appglue, deepsleep, ugfx, badge, machine, sys
1010

1111
services = [] #List containing all the service objects
1212
loopCallbacks = {} #Dict containing: {<FUNCTION>:<Wifi required on next run>}
@@ -85,8 +85,9 @@ def setup(pmCb=None, drawCb=None):
8585
# Import the service.py script
8686
try:
8787
srv = __import__('lib/'+app+'/service')
88-
except BaseException as msg:
89-
print("[SERVICES] Could not import service of app "+app+": ", msg)
88+
except BaseException as e:
89+
print("[SERVICES] Could not import service of app "+app+": ")
90+
sys.print_exception(e)
9091
continue #Skip the app
9192

9293
if wifiInSetup:
@@ -109,8 +110,9 @@ def setup(pmCb=None, drawCb=None):
109110

110111
try:
111112
srv.setup()
112-
except BaseException as msg:
113-
print("[SERVICES] Exception in service setup "+app+": ", msg)
113+
except BaseException as e:
114+
print("[SERVICES] Exception in service setup "+app+":")
115+
sys.print_exception(e)
114116
continue
115117

116118
if loopEnabled:
@@ -157,8 +159,9 @@ def loop_timer():
157159
rqi = 0
158160
try:
159161
rqi = cb()
160-
except BaseException as msg:
161-
print("[SERVICES] Exception in service loop: ", msg)
162+
except BaseException as e:
163+
print("[SERVICES] Exception in service loop:")
164+
sys.print_exception(e)
162165
newLoopCallbacks.pop(cb)
163166
continue
164167
if rqi>0 and rqi<requestedInterval:
@@ -200,8 +203,9 @@ def draw_timer():
200203
try:
201204
[rqi, space_used] = cb(y)
202205
y = y - space_used
203-
except BaseException as msg:
204-
print("[SERVICES] Exception in service draw: ", msg)
206+
except BaseException as e:
207+
print("[SERVICES] Exception in service draw:")
208+
sys.print_exception(e)
205209
newDrawCallbacks.pop(i)
206210
continue
207211
if rqi>0 and rqi<requestedInterval:
@@ -242,5 +246,6 @@ def force_draw(disableTimer):
242246
try:
243247
[rqi, space_used] = cb(y)
244248
y = y - space_used
245-
except BaseException as msg:
246-
print("[SERVICES] Exception in service draw: ", msg)
249+
except BaseException as e:
250+
print("[SERVICES] Exception in service draw: ")
251+
sys.print_exception(e)

esp32/modules/splash.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def power_countdown_callback():
6060
print("[PM] Sleep for "+str(requestedStandbyTime)+" ms.")
6161
deepsleep.start_sleeping(requestedStandbyTime)
6262
else:
63-
print("[PM] BPP forever.")
63+
print("[PM] Sleep forever.")
6464
deepsleep.start_sleeping()
6565

6666
# Graphics

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