cancel
Showing results for 
Search instead for 
Did you mean: 

Updating scroll List Number of Items updates screenViewbase.cpp but not screenViewbase.hpp

ARM_and
Associate

I created a new screen and added a Scroll List. Initially setting the number of items to 9 and generating.

Trying understand a separate behaviour, I later changed the number of items in the scroll list in Designer to 12 and the sim crashes.

 

ARM_and_1-1750432265928.png

 

It seems that the screenbase.hpp header shows the original declaration:

    touchgfx::DrawableListItems<ListMenuItem, 9> scrollList1ListItems;

but the screenbase.cpp correctly sets the updated number of 12:

    scrollList1.setNumberOfItems(12);

 But now we seem to have an index past the array issue and it crashes:

ARM_and_0-1750432212219.png

I secretly modified the read only header file to match the array size, compiled the sim outside of TouchGFX designer and it ran without errors until I regenerated in designer.

The weird part is that TouchGFX designer insists of having that array still init to _9_ NO MATTER what the number of item setting is.  For example, setting it 3 will still lead to 9 in screenViewBase.hpp:

 

    touchgfx::DrawableListItems<ListMenuItem, 9> scrollList1ListItems;

 

Which sounds like a memory usage issue.

I'm very new to TouchGFX and apologies if I've done this wrong. My first thought was that creating 9 List Menu Items in memory fills the screen and allows recycling of the list items the same way iOS does. But the sim crashes and the MCU doesn't display anything (likely due to crash).

 

 

 

0 REPLIES 0