2021-07-30 01:38 PM
Hi, I'm using an STM32H725 with TouchGFX. I using a custom FMC interface to an LCD.
I'm using the following timer interrupt set at 60Hz to drive the TouchGFX engine as recommended as per documentation. (This is a bare-metal implementation) I have verified that the timer call every 60Hz through a debug pin to oscilloscope.
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{
// check which version of the timer triggered this callback
if (htim == &htim7) // set to approximately 60Hz
{
HAL_GPIO_TogglePin(DebugTimer_GPIO_Port,DebugTimer_Pin);
++Global_Time60Hz;
touchfgx_signalVSync();
}
}
However, when I try to say for example use a clock on a TouchGFX screen, the clock increments wayyyyyy to fast. What can be the cause of this?
void Screen3View::handleTickEvent()
{
if (tickCounter++ % 60 == 0) //60
{
if (++digitalSeconds >= 60)
{
digitalSeconds = 0;
if (++digitalMinutes >= 60)
{
digitalMinutes = 0;
if (++digitalHours >= 24)
{
digitalHours = 0;
}
}
}
// Update the clock
Timer.setTime24Hour(0, digitalMinutes, digitalSeconds);
}
}