How to integrate my own .c files to Touch GFX generated code?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-12 4:54 AM
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-15 8:53 AM
Better explai your question in normal TouchGFX is implemented with RTOS and your c code is run as next thread .
Then you hav etwo ways howto send values to GUI.
- Use queue messages RTOS system from one thread to other, examples in TouchGFX docu. Good for multicore MCUS.
- Simpler method on single core RTOS run, is create for example struct with shared values between GUI and other threads and use it simply for example in handletick , struct is created in c and included as extern c in view.cpp
if (tickCounter % 2 == 0 && lastvalue != SharedStruct.newvalue) {
imageProgressL.setValue(SharedStruct.newvalue);
lastvalue = SharedStruct.newvalue;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-12 5:37 AM
Why c files, GFX is cpp. Or better is your project managed only in designer or you use IDE ?
In normal IDE is used for custom projects and all files need be added to for example core or gui folders, not to in name generated files/folders.
Then project refresh show new files and manage make.
If only designer is used , is required manual edit makefiles usw... beter is use existed files only.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-15 3:08 AM
Hi @MM..1​ Thanks for your reply.
I have my sensor application code in .c. I want to show the sensor values on display. My working sensor application is in STM32CubeIDE and getting the values on Tera Term (UART). So, how to integrate Touch GFX generated code to my sensor code and show the output on display?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-15 8:53 AM
Better explai your question in normal TouchGFX is implemented with RTOS and your c code is run as next thread .
Then you hav etwo ways howto send values to GUI.
- Use queue messages RTOS system from one thread to other, examples in TouchGFX docu. Good for multicore MCUS.
- Simpler method on single core RTOS run, is create for example struct with shared values between GUI and other threads and use it simply for example in handletick , struct is created in c and included as extern c in view.cpp
if (tickCounter % 2 == 0 && lastvalue != SharedStruct.newvalue) {
imageProgressL.setValue(SharedStruct.newvalue);
lastvalue = SharedStruct.newvalue;
}
