2021-01-08 01:13 PM
Hi all,
I would like to know how to use "handleTickEvent" on AnalogClock.
I draw a screen with a Analog but thisone never upate itself.
I see other examples witch use handleTickEvent to execute a new render but all has the same configurations..
The strange thing is that In my code this routine is called for about 10 times only when touchscreen is pressed.
this is my code:
void Screen2View::handleTickEvent()
{
tickCounter++;
if (tickCounter % 60 == 0)
{
if (++analogSeconds >= 60)
{
analogSeconds = 0;
if (++analogMinutes >= 60)
{
analogMinutes = 0;
if (++analogHours >= 24)
{
analogHours = 0;
}
}
}
// Update the clocks
analogClock1.setTime24Hour(analogHours, analogMinutes, analogSeconds);
}
}
class Screen2View : public Screen2ViewBase
{
public:
Screen2View();
virtual ~Screen2View() {}
virtual void setupScreen();
virtual void tearDownScreen();
virtual void handleTickEvent();
protected:
int tickCounter;
int analogHours;
int analogMinutes;
int analogSeconds;
};
I don't understand the reason : Must I add something else in my code? (I copy the settings from an 743I-EVAL template).
thanks in advance.
Solved! Go to Solution.
2021-01-09 02:02 AM
Maybe your touch IC driver pool continuously and block , and i see Screen2, what your screen1? Have handleTick?
2021-01-09 01:11 AM
Primary you dont write how type LCD management you use. Full, partial, LTDC , SPI , custom ?
handleTick work ok only when driver for refresh display works ok. And too touching driver ok.
For check place breakpoint here and maybe add line
analogClock1.setTime24Hour(analogHours, analogMinutes, analogSeconds);
analogClock1.invalidate();
2021-01-09 01:40 AM
Hi,
i'm using LTDC on my STM32H743VIT6.
In debug I see that handleTickEvent is called only when I touch the screen.
VSYNC period is 16.7ms.
after I checked that HAL_LTDC_LineEventCallback(LTDC_HandleTypeDef *hltdc) is called continuosly.
Should not handleTickEvent work?
Whatelse must I check?
2021-01-09 02:02 AM
Maybe your touch IC driver pool continuously and block , and i see Screen2, what your screen1? Have handleTick?
2021-01-09 03:54 AM
HI,
thank for your suggestion.
The problem was touch IC driver pool continuously and block the system.
The problem was on ext interrupt handler. I change my code from:
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
if(GPIO_Pin == CTP_INT_PIN_Pin)
{
CTP_TS_Work_Func();
}
}
to :
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
if(GPIO_Pin == CTP_INT_PIN_Pin)
{
if (GPIO_PIN_SET == HAL_GPIO_ReadPin (CTP_INT_PIN_GPIO_Port, CTP_INT_PIN_Pin))
{
__HAL_GPIO_EXTI_CLEAR_IT(CTP_INT_PIN_Pin); // Clean interrupt flag before proceeding to service the interrupt
CTP_TS_Work_Func();
}
}
}
It wotk perfectly! Thank you very much for your advise!