Replies: 2 comments 5 replies
-
OK so in Micropython everything is based on some kind of a thread or task. On the ESP32 there are multiple cores and code is able to run parallel. The problem is that MicroPython actually only runs on one of those cores. Any application that gets written needs to have some kind of a loop that keeps the program from exiting before it is time to exit. MicroControllers are no different. The loop in MicroPython occurs in it's own code and that location is where it is checking for input from the REPL. If you take a look at the code here... you will see that the task handler uses a MicroPython Timer to handle calling That causes an issue... If the user has any looping code that keeps MicroPython from being able to check the REPL then guess what? The scheduled tasks never gets checked so lv_task_handler never gets called. In the touchscreen calibration there is looping code that stops MicroPython from checking scheduled tasks. That is the reason why you see that function being called. That function checks to see if there are any tasks that need to be run and it runs them if there are. It's a way to allow stalling the program to wait some something but still have the UI update properly. |
Beta Was this translation helpful? Give feedback.
-
But if there is only two cores, and LVGL is running on one and the REPL is
running on the other, where will it run?
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Greetings! I am always thank you for the lvgl micropython.
I am looking into the 'touch_calibration.py' and came across the lcd_bus._pump_main_thread() method, but I'm entirely no idea on its specific purpose and use case.
Please kindly help me understand.
lvgl_micropython/api_drivers/py_api_drivers/frozen/indev/touch_calibration/touch_calibrate.py
Line 94 in 9dbf21f
Beta Was this translation helpful? Give feedback.
All reactions