nikthefix / Lilygo_Support_T_Display_S3_Long_TFT_eSPI_Volos-nikthefix

16 stars 2 forks source link

Frozen touch on screen refresh #6

Open d3mac123 opened 2 months ago

d3mac123 commented 2 months ago

Hey @nikthefix I am using your code as example and I noticed everything (touch wise) work great as the screen only updates on a touch. However, in my app, I need to refresh the screen on loop (to display a chronograph and a sensor data). In doing so, the app freezes - touching is not accepted, neither the sensor data is updated.

I guess the issue is related to the "ELSE" part of the loop. For now, lets just assume my UI design is done in the draw() function as well. If I call it outside the digitalRead, the sensor data shows fine but the touch part stop to work (maybe because the constant refresh blocks it?). Any ideas on how to show the sensor data in the loop function?

nikthefix commented 2 months ago

@d3mac123

Hi there. Yes it sounds like the chronograph and sensor screen update functions are blocking the touch sense test in the main loop. I recommend that you place all calls to update the display in the main loop so that touch monitoring is integrated with the conditional tests for screen update.

Alternatively you could place a touch interrupt pin test inside your draw function. Then you know that while drawing, the code is also monitoring the touch status and can 'gosub' to service the touch after the completion of the last frame.

I had a water leak in my electronics work room so I had to dismantle all my gear and move it out temporarily while I re-plaster. Should be up and running again in a few days and will be able to offer more help if needed.

d3mac123 commented 2 months ago

I'm so sorry for your troubles and I hope everything gets back on track sooner than later.

No hurries/worries. When (and if) you have time, if possible, show me a quick sample.

Thank you!

Alex Souza On Feb 21, 2024 at 10:27 AM -0500, nikthefix @.***>, wrote:

@d3mac123 Hi there. Yes it sounds like the chronograph and sensor screen update functions are blocking the touch sense test in the main loop. I recommend that you place all calls to update the display in the main loop so that touch monitoring is integrated with the conditional tests for screen update. Alternatively you could place a touch interrupt pin test inside your draw function. Then you know that while drawing, the code is also monitoring the touch status and can 'gosub' to service the touch after the completion of the last frame. I had a water leak in my electronics work room so I had to dismantle all my gear and move it out temporarily while I re-plaster. Should be up and running again in a few days and will be able to offer more help if needed. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

nikthefix commented 2 months ago

Will do.