cancel
Showing results for 
Search instead for 
Did you mean: 

Screen redraw

kvl
Associate II

Hi,

I have a problem redrawing the screen after changing the content. I am using FreeRTOS and TouchGFX runs in one task, and the modifications runs from a different task.

The constructor of the screen adds all drawables to the screen object. But they are not visible yet, as the content is not yet defined. The content are configured later from a different task, but to get the screen redrawn I have to make some workarounds. E.g. if I call the updateAngles() method of a single TextureMapper object, the screen normally redraws perfectly like this:

0690X000009YNs5QAG.jpg

But sometimes only the half of the widgets are redrawn like this:

0690X000009YNsAQAW.jpg

And when calling the updateAngles() again, the other half are redrawn:

0690X000009YNsFQAW.jpg

Odd. Do I have a problem with two different frame buffers? Should I do something special to redraw a screen after modifications? Is it wrong to update the screen from a different task? (The screen object are made globally accessable bu using a pointer to the object, assigned in the screen Presenter object constructor.)

Calling invalidate() on all drawable objects, or calling the draw() method for the screen itself, seems to have no effect.

BR

Kasper

2 REPLIES 2
Marco.R
Senior

​Hi Kasper

I've had a similar problem that the content was not updating correctly (see link below). It is very important to update the content within the tick-method of the model. I assume that it works correctly in the simulator.

https://community.st.com/s/question/0D50X0000AhQ1xU/old-contentscreen-when-updating-information-on-screen

Best regards

Marco

kvl
Associate II

Hi,

Perfect. I moved the draw(); call to the tick handler, and it works nicely. The rest of the updates are stille called asynchronously from a different task, but it seems stable.

Thanks Marco.