TouchGFX obvious flickering of "Text Area" widget
- October 10, 2020
- 1 reply
- 1373 views
Hello,
I have connected two latching type push buttons to two GPIOs and using TouchGFX to see the physical status on a demo screen with glowing buttons.
Some background information:
BUTTON_STATE_T is a structure containing 2 int members for GPIO states and a copy is updated in Model.cpp on every Model::tick();
Both buttons on the screen are "TOGGLE BUTTON" widgets with "TEXT AREA" on top of them. I do not intend to use "Button With Label" herein. No wildcards are used in this screen
I have below code snippet that produces the touchgfx scene behavior as seen in the attachment.
GpioStatusView.cpp
void GpioStatusView::handleTickEvent()
{
// get fresh GPIO states
BUTTON_STATE_T *bs = presenter->getButtonStateFromModel();
if(bs->inputPinA == 1)
buttonA.forceState(true);
else
buttonA.forceState(false);
if(bs->inputPinB == 1)
buttonB.forceState(true);
else
buttonB.forceState(false);
buttonA.invalidate();
buttonB.invalidate();
}There is some obvious flickering that can be seen on invalidated text area (also upon touch interaction). It is more obvious to naked eye rather than in the attached video
I am not sure if I am using the invalidate() along with handleTickEvent() correctly?
Is this method a good practice to update GUI instantaneously?
Things I have tried:
1.Explicitly invalidating the text areas along with button invalidate
Environment:
Windows 10 x64
CubeIDE 1.4.0
CubeMX6.0.1
TouchGFX 4.14.0
STM32F7508-DK
MCU PACKAGE FW_F7_V1.15.0
Please suggest on this
Thanks,
Eshwar