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

+8-2
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)