cancel
Showing results for 
Search instead for 
Did you mean: 

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

Wrend.1
Senior

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.

3 REPLIES 3
Martin KJELDSEN
Chief III

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

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

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