Closed elengr closed 1 year ago
In general, you should set some flag in the interrupt function and terminate processing immediately. The actual communication should be done in the main loop. You can do getTouch when the flag is set.
This is the job of the user code, not the GFX.
I mentioned flags earlier, but the recommended method for ESP32 would be to use the FreeRTOS functionality to handle notifications between tasks.
Thanks for your advise :) Have a nice day.
Read touch screen in an interrupt
Hey there I hope you are having a great day, I am working on a project with the LovyanGFX library. After finishing the project we wanted to add interrupts to our code. My issue is that I need to read the x and y coordinates for touch. I notice that lcd.getTouch(&x, &y); is frequently used. However, I cannot use this command within an interrupt because, as far as I can tell, it is an interrupt. Do you have any suggestions on what I should do?
Thank you in advance.