I’d like to use a single task handler for multiple tasks. So inside the handler I’d like to distinguish between the different sources. My idea was to compare the task given to the handler with the one returned at task creation. Surprisingly this comparison fails:
task = None def my_task(ltask): global task print(ltask, task, ltask == task) task = lv.task_create(my_task, 1000, lv.TASK_PRIO.MID, None)
and the code prints:
struct lv_task_t struct lv_task_t False
Usually one would use the user_data pointer for things like that. But this is already being used by MP itself. Is it possible to retrieve lv_task specific information inside the task handler in MP? I just need to be able to tell inside the handler which of my tasks actually called it. In my example there’s only one task, but there are supposed to be more of them using one single wrapper handler that does some additional magic.
I did similar in lvgl event callbacks and there the comparison works.