Question
getTextWidth() function returns wrong values only on target PCB.
A simple screen with one TextArea and one wildcard:
Below is the code that updates the field in the wildcard and displays the total width of the text on the terminal.
The problem is that in the simulator the getTextWidth() function works correctly, while on the target PCB (STM32L4P5) the data is read incorrectly. Below is a screenshot from the terminal and the PCB.
void Screen1View::tick()
{
counter++;
if (counter > 10)
{
counter = 0;
param++;
Unicode::snprintf(textArea1Buffer, TEXTAREA1_SIZE, "%d", param);
#ifdef SIMULATOR
touchgfx_printf("param: %d, getTextWidth: %u\n", param, textArea1.getTextWidth());
#else
TRACE("param: %d, getTextWidth: %u\r", param, textArea1.getTextWidth());
#endif
textArea1.invalidate();
}
}
Anyone had a similar problem? What could be the reason for this behavior?
