Closed julr closed 3 months ago
This shouldn't be necessary, the configuration of the interrupt should be handled by this line automatically.
A couple questions:
Thanks for the quick reply. You are absolutely correct. My touch device seems to be a bit unstable using the interrupt mode which caused me to believe that this might be a problem. I will investigate this further and possibly just switch to polling mode (which works fine).
Sounds good, if you need help feel free to reach out and I'll do what I can. FWIW, I've mostly used polling mode and have found it to be reasonably fast. I do know there are some adjustments in this area for LVGL 9.x but I haven't upgraded beyond LVGL 8.4.x yet.
I'm currently using this xpt2046 driver together with the esp_lvgl_port component which makes lvgl integration a lot easier. For example it provides all the callbacks and boilerplate code. This means that the callback for the touch device is set in a separate step after the
esp_lcd_touch_handle_t
struct has been initialized byesp_lcd_touch_new_spi_xpt2046()
. However the actual interrupt functionality of the pin is only activated when a callback is set which is not known at that stage so theinterrupt_callback
field inside theesp_lcd_touch_config_t
struct instance is initialized toNULL
. The check is implemented here esp_lcd_touch_xpt2046.c, line 108As a workaround I added
between the calls to
esp_lcd_touch_new_spi_xpt2046()
andlvgl_port_add_touch()
otherwise no touch events would be registered.A possible fix would be to remove the if condition mentioned above. However, this is my first time working with an ESP32 and the ESP-IDF so I don't know what would happen if a pin interrupt triggers without a registered callback routine.