Jump to content

Disabling touch during drawing


Asaliii

Recommended Posts

Hello @Asaliii and welcome to the µGFX community!

That really sounds like a bug in your software. That's definitely unexpected behavior. Disabling the touchscreen is a very ugly work around that won't solve your problem in the long run. I'd rather encourage you to fix the problem you're actually having. Can you tell us more about your code?

Link to comment
Share on other sites

You talk about icons. Did you write some custom widget? Are you using an existing widget with a custom rendering? Are you using existing widget code completely unmodified? Can you provide a minimum test case that allows us to reproduce the problem? Did you try to reproduce the problem when running your µGFX GUI on Windows, Linux or some other desktop system? 

Did you even try to debug the problem? Did you check for stack overflows? What kind of crash are you getting?

Link to comment
Share on other sites

Let me suggest you start with one of the simple gwin demos. If you are having the same problem there it gives us a good idea on where to start to debug. If the demo works without the same symptom then the problem is likely in the way you have done something that is different to the demos.  In that situation it is much harder for us to help without seeing all your code.

In this forum we help people find problems relating to the way uGFX works. We are not a general debugging service although we can offer that on a commercial basis. If you are having problems always go back to the provided demos as they are known to work well on supported platforms and are easy for us to find os related issues on other platforms.

Link to comment
Share on other sites

this is the example of my icons on that screen:

I have defined my own custom drawing functions.

image.png.c7072cbde377ecb41e868609e2f7b7bb.png

the screen is a little bit complicated. it read some data and images from 2 different external SPI flashes. When I run the screen on PC I don't see this issue and when I debug it, it stuck somewhere in my dma transmission functions. do definitely it's not a graphic issue. the problem is somewhere in lower level of drivers or maybe tasks priorities. 

disabling the touch for me was kind of a way to avoid seeing the issue not fixing the issue. 

 

 

Link to comment
Share on other sites

I think just turning off the touch processing is unlikely to solve your problem.

This sounds like an interaction between your DMA and the SPI/I2C interface used by the touch.

Given the extra detail that you have now provided this is sounding like an interrupt priority issue, perhaps an interrupt stack overflow, hardware resource conflict, or something else directly hardware related and therefore outside the scope of what can be controlled by uGFX.

Turning off the touch processing by the gwin system will still leave the touch polling active and thus the problem is unlikely to go away. It is a much more difficult job to turn off touch polling as this happens at the driver level and would require custom library modifications.

If you really want to play with the touch polling (and I would suggest that you don't) - the place to look is in src/ginput/ginput_mouse.c. You will need to stop the "MouseTimer" and then correctly re-enable it again afterwards. Note that doing this will not have any affect on an interrupt driven touch device as they don't require polling. Most touch devices however are not interrupt driven (usually because interrupt capabilities on touch devices tend to be VERY buggy).

Link to comment
Share on other sites

gtimerStop (&MouseTimer) and gtimerStart (...) to restart it.

There are 2 complications...

1. MouseTimer is local to that C file.

2. The correct parameters will need to be passed to the gtimerStart.

Let me say again, just stopping the timer is NOT a good solution and may not solve your problem. You really need to get to the bottom of what the hardware conflict is.

Link to comment
Share on other sites

11 hours ago, inmarket said:

Let me say again, just stopping the timer is NOT a good solution and may not solve your problem. You really need to get to the bottom of what the hardware conflict is.

Please take that advice. Everything else is just getting you further down the rabbit hole. You might get it "working" eventually but then you'll have a non-standard version of the µGFX library which means that you can't just update to a newer version in the future that will contain bug fixes and new features. Furthermore, when you proceed with your project and you start adding other peripherals and so on you might end up getting the same lock-up again and that time you can't just modify µGFX sources to bypass the problem.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...