Skip to main content
Wrend.1
Associate III
October 13, 2020
Question

How to deal with assertion "timerWidgets.size() < MAX_TIMER_WIDGETS"

  • October 13, 2020
  • 3 replies
  • 1965 views

It like this0693W000004JX8gQAG.pngAnd this code leads to it(in customContainer).

Application::getInstance()->registerTimerWidget(this);

 And I try to modify the MAX_TIMER_WIDGETS from 32 to 64. It not works.

This topic has been closed for replies.

3 replies

Martin KJELDSEN
Principal III
October 13, 2020

Hi,

The way to deal with this is to bundle your widgets together, if possible. You may have a lot of different "timer widgets" that in essence could be gathered in one container. That container could then distribute the tick() to each of its components. Less subscribers, smaller footprint. That's why there's a limit.

/Martin

DKing.1
Associate II
January 30, 2022

Hi,

I am likewise hitting this issue. I understand the concept of distributing the tick to reduce the number of widgets that require the tick to at most 32. But don't understand in practice how one would 'bundle widgets'. With our UI, the tick receiving widgets are SwipeContainer, FadeAnimator enabled Image, and FadeAnimator enabled TextArea. Are you saying Martin that we should create for example a custom SwipeContainer widget, that instead receives tick from some common source?

Also, I don't understand why, in Middlewares\ST\touchgfx\framework\include\touchgfx\application.hpp, if we change MAX_TIMER_WIDGETS, even to the uint8_t maximum of 255, we still get this runtime assertion. I am fairly sure I don't have anywhere near 255 such widgets.

Best regards,

David

Martin KJELDSEN
Principal III
January 31, 2022

Hi David,

That's exactly what i'm saying. So you have a custom container with the widgets you need, then you call tick() on each of them from the top level ::handleTickEvent()

/Martin