Hi everyone!
I am trying to achieve the following behaviour with lvgl micropython: a function/task creates a task which will be run once in x ms and get deleted then.
Creating a recurring task which would delete itself would be also useful. So far i found no solution how to this.
here some of my code, how i do it at the moment:
task_1 = lv.task_create(lambda task: led_toggle(), 1000, lv.TASK_PRIO.MID, None)
lv.task_create(lambda task: dimas_kohlemine.produce_ware(), 1000, lv.TASK_PRIO.HIGH, None)
lv.task_create(lambda task: gui_refresh_gauge(), 100, lv.TASK_PRIO.HIGH, None)
lv.task_create(lambda task: check_button_entladen_enabled(), 100, lv.TASK_PRIO.HIGH, None)
https://docs.lvgl.io/v7/en/html/overview/task.html
One-shot tasks
You can make a task to run only once by calling
lv_task_once(task)
. The task will automatically be deleted after being called for the first time.
This seems not available for the micropython bindings.
Also things like task_1._del() or task_1 = None doenst work. Could anyone point me in the right direction?