2023-01-09 12:09 PM
2023-01-19 08:08 PM
I'm new to TouchGFX, but I believe I have a decent answer:
You will need to call the signalVSync occasionally. This works as a driving mechanism for the engine. It pushes a message onto the queue that the engine is waiting for.
That function is found in the OSWrappers:: class. Add this to the TouchGFXHAL.cpp file:
extern "C"
void TE_Handler(void)
{
/* VSync has occurred, increment TouchGFX engine vsync counter */
touchgfx::HAL::getInstance()->vSync();
/* VSync has occurred, signal TouchGFX engine */
touchgfx::OSWrappers::signalVSync();
}
The TE_Handler will need to be called after an amount of time that represents an amount of time that would take to write the entire screen + some buffer time.
extern void TE_Handler(void);
extern void TE_Handler(void);
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{
/* USER CODE BEGIN Callback 0 */
/* USER CODE END Callback 0 */
if (htim->Instance == TIM6) {
HAL_IncTick();
}
/* USER CODE BEGIN Callback 1 */
else if( htim->Instance == TIM5 )
{
TE_Handler();
}
/* USER CODE END Callback 1 */
}
Too fast and the screen won't be written completely and you will get artifacts.