Skip to main content
MPast.1
Senior
January 8, 2021
Solved

AnalogClock and handleTickEvent()

  • January 8, 2021
  • 1 reply
  • 1002 views

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.

    This topic has been closed for replies.
    Best answer by MM..1

    Maybe your touch IC driver pool continuously and block , and i see Screen2, what your screen1? Have handleTick?

    1 reply

    MM..1
    Chief III
    January 9, 2021

    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();

    MPast.1
    MPast.1Author
    Senior
    January 9, 2021

    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?

    MM..1
    MM..1Best answer
    Chief III
    January 9, 2021

    Maybe your touch IC driver pool continuously and block , and i see Screen2, what your screen1? Have handleTick?