What calls touch.read() for xpt2046?

I’m using my own MicroPython fork on an esp32 with lvgl added and the ili9341 drivers works, but so far no luck with a xpt2046 touch panel. All the examples I see have a while True: pass loop commented out at the end and I see lv.indev_drv_register in the xpt2046 driver. So something needs to call lv somewhere periodically to keep things running? Where is that supposed to happen?

Hi @tve,
The commented “while true” is not really important. If you run the Unix port with the script as an argument, it will exit immediate without it. But this is irrelevant to esp32, and even with the Unix port I discovered it’s possible to run with the “-i” option and get the REPL while still providing a script as an argument.

You are right that something has to call lvgl periodically. Not only for the touch driver, also for the screen rendering.
That something is lvesp32 module which schedules periodically calls to lv_task_handler.
There are equivalents for other platforms. On the Unix port this is done by the SDL or FB driver. On stm32 it’s done by lvstm32 module

1 Like

I see, somehow something with lvesp32 isn’t happening… Looking…