ST意法半导体
直播中

李刚

8年用户 1397经验值
私信 关注
[问答]

如何在AnalogClock上使用“ handleTickEvent ”?

大家好,
我想知道如何在 AnalogClock 上使用“ handletickEvent ”。
我用模拟画了一个屏幕,但这个从来没有更新过自己。
我看到其他示例女巫使用handleTickEvent来执行新的渲染,但所有示例都具有相同的配置。
奇怪的是,在我的代码中,只有在按下触摸屏时,这个例程才会被调用大约 10 次。
这是我的代码:
  • 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;
  • };
我不明白原因:我必须在代码中添加其他内容吗?(我从 743I-EVAL 模板复制设置)。
提前致谢。








回帖(1)

张蕾

2023-1-10 13:48:20
也许你的触摸 IC 驱动程序池不断地阻塞,我看到 Screen2,你的 screen1 是什么?有handleTick吗?
举报

更多回帖

发帖
×
20
完善资料,
赚取积分