Skip to content

Commit a3bbb83

Browse files
authored
Merge pull request SHA2017-badge#185 from SHA2017-badge/new_draw_argument
Add a new optional argument to the draw() function in a service, whic…
2 parents 722f35d + d914aed commit a3bbb83

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

esp32/modules/tasks/services.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,10 @@ def draw_task():
137137
rqi = 0
138138
try:
139139
cb = drawCallbacks[i].draw
140-
[rqi, space_used] = cb(y)
140+
try:
141+
[rqi, space_used] = cb(y, False)
142+
except:
143+
[rqi, space_used] = cb(y)
141144
y = y - space_used
142145
except BaseException as e:
143146
print("[SERVICES] Exception in service draw:")
@@ -188,7 +191,10 @@ def force_draw(goingToSleep=False):
188191
cb = srv.draw_going_to_sleep
189192
except:
190193
cb = srv.draw
191-
[rqi, space_used] = cb(y)
194+
try:
195+
[rqi, space_used] = cb(y, True)
196+
except:
197+
[rqi, space_used] = cb(y)
192198
y = y - space_used
193199
except BaseException as e:
194200
print("[SERVICES] Exception in service draw: ")

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