Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c99eda5

Browse files
committed
libs/m5ui: Wait for LVGL tasks on deinit.
Signed-off-by: lbuque <[email protected]>
1 parent 5ac4590 commit c99eda5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

m5stack/libs/m5ui/port.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import sys
77
import lv_utils
88
import micropython
9+
import time
910

1011
_event_loop_instance = None
1112

@@ -48,6 +49,8 @@ def task_handler(self, _):
4849
def deinit(self):
4950
if hasattr(self, "timer"):
5051
self.timer.deinit()
52+
while self.scheduled > 0:
53+
time.sleep_ms(20)
5154
event_loop._initialized = False
5255
event_loop._instance = None
5356

0 commit comments

Comments
 (0)