2019-04-16 03:39 AM
Hello
I'm using TouchGFX 4.10 with a custom board (STM32F767) and I have a problem, where old value/content will be displayed when updating another value on screen.
Procedure in which the problem occurs:
I don't know where the problem is, but I assume it has something to do with the doublebuffering. When I invalidate both values in every steps, it works correctly.
But this can/should not be the solution, because this happens not only with texts also with bitmaps and other widgets.
Has anyone an idea what is wrong?
Thanks
Best regards
Marco
Solved! Go to Solution.
2019-04-23 04:04 AM
A few side notes:
2019-04-23 06:53 AM
To your side notes:
- After entering the screen, everthing is displayed correctly
- I use fixed size for the text. This is easier to handle, with our design requirements.
Unfortunately it is not allowed to me to share the project on a forum. If you provide me your e-mail address I could send you the project (only the touchgfx parts of it).
With the simulator it works fine. So I don't think it is an issue with the simulator, too. Interestingly, both texts are updated in the simulator, even if only one text changes (seen with F2 option is active in the simulator)
I also tried to reproduce it with a simple example on an Eval-board. It's no problem either. The behaviour of the DMA is the same.
So I tried to find out the difference between the example and our code. The only thing I see is that we are updating the screen outside the tick method of the model. Could this be the problem? I'll try tomorrow, if it works better when I update the screens only in the tick method.
2019-04-24 12:40 AM
Hi @Martin KJELDSEN
I refactored the code (from previous post) like this:
void Model::tick()
{
if (modelListener != 0)
{
if (m_valueAChanged)
{
modelListener->updateValueA(m_valueA);
m_valueAChanged = false;
}
if (m_valueBChanged)
{
modelListener->updateValueB(m_valueB);
m_valueBChanged = false;
}
}
}
void Model::updateValueA(const uint32_t newValue)
{
m_valueA = newValue;
m_valueAChanged = true;
}
void Model::updateValueB(const uint32_t newValue)
{
m_valueB = newValue;
m_valueBChanged = true;
}
Now everything works as expected. It looks like it is very important that the screen updates has to be done within the tick method.
Thank you for your help
Best regards
Marco
2019-04-29 12:41 AM
Hi Marco,
Glad you got it working. Yes, tick() is the heart of your application. Whether it be from Model::tick() and then through a modelListener or otherwise, or through the tick method in your view.
/Martin