cancel
Showing results for 
Search instead for 
Did you mean: 

TOUCHGFX While loop issue

amorftor
Associate II

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?

1 ACCEPTED SOLUTION

Accepted Solutions

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 MORADI
ST Software Developer | TouchGFX

View solution in original post

1 REPLY 1

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 MORADI
ST Software Developer | TouchGFX