Skip to main content
Associate II
August 18, 2023
Solved

TOUCHGFX While loop issue

  • August 18, 2023
  • 1 reply
  • 1326 views

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.
Best answer by Mohammad MORADI ESFAHANIASL

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 

1 reply

ST Employee
September 1, 2023

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