Skip to main content
Associate II
Aug 18, 2023 1:43 PM UTC
Solved

TOUCHGFX While loop issue

Hello guys, I have a question. I am using touchgfx. When I use the while loop in my Model.Cpp file, the application stops. It does this without entering the while loop. Can't use loops in Model.Cpp? Do you have any knowledge about this topic?

This topic has been closed for replies.
ST Employee
Sep 1, 2023 12:56 PM UTC

Hello @amorftor ,

TouchGFX uses MVP design pattern, which means it uses Model to hold or transfer data between different parts of the application or outside of the application (for instance, communicating with the board). Therefore, loops or any application logic should not be used inside the Model class. 

You can read more about the TouchGFX design pattern here:

https://support.touchgfx.com/docs/development/ui-development/software-architecture/model-view-presenter-design-pattern

I hope this helps you 

Mohammad MORADIST Software Developer | TouchGFX

1 reply

ST Employee
Sep 1, 2023 12:56 PM UTC

Hello @amorftor ,

TouchGFX uses MVP design pattern, which means it uses Model to hold or transfer data between different parts of the application or outside of the application (for instance, communicating with the board). Therefore, loops or any application logic should not be used inside the Model class. 

You can read more about the TouchGFX design pattern here:

https://support.touchgfx.com/docs/development/ui-development/software-architecture/model-view-presenter-design-pattern

I hope this helps you 

Mohammad MORADIST Software Developer | TouchGFX