File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
internal_filesystem/lib/mpos Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -9,11 +9,15 @@ class TaskManager:
99 disabled = False
1010
1111 @classmethod
12- async def _asyncio_thread (cls , ms_to_sleep ):
12+ async def _asyncio_thread (cls , sleep_ms ):
1313 print ("asyncio_thread started" )
1414 while cls .keep_running is True :
15- #print(f"asyncio_thread tick because {cls.keep_running}")
16- await asyncio .sleep_ms (ms_to_sleep ) # This delay determines how quickly new tasks can be started, so keep it below human reaction speed
15+ #print(f"asyncio_thread tick because cls.keep_running:{cls.keep_running}")
16+ # According to the docs, lv.timer_handler should be called periodically, but everything seems to work fine without it.
17+ # Perhaps lvgl_micropython is doing this somehow, although I can't find it... I guess the task_handler...?
18+ # sleep_ms can't handle too big values, so limit it to 30 ms, which equals 33 fps
19+ # sleep_ms = min(lv.timer_handler(), 30) # lv.timer_handler() will return LV_NO_TIMER_READY (UINT32_MAX) if there are no running timers
20+ await asyncio .sleep_ms (sleep_ms )
1721 print ("WARNING: asyncio_thread exited, now asyncio.create_task() won't work anymore" )
1822
1923 @classmethod
You can’t perform that action at this time.
0 commit comments