2020-04-13 07:05 AM
Currently, it appears that there are not "User Code" areas in TouchGFX target files which can be protected by a CubeMX generation.
This is possible throughout core/main.c and Hal drivers and it would be nice to have for TouchGFX Generator files as well.
This would be very useful, especially when adding dynamic bitmap cache to the registerBitmapDatabase() function call in TouchGFXConfiguration.cpp.
It is likely that it cannot be currently be done, but would it be possible to add to future releases?
2020-04-16 10:53 AM
Anybody?
2020-04-24 08:56 AM
Not getting many answers these days.
I created a work around, but it is not very elegant. All it does is cause a compile error me when this file has been overwritten by a CubeMX Generate.
I would think that if adding dynamic bitmap cache is an option in the call to registerBitmapDatabase() there would be a better way to use this option than modifying code that will be overwritten whenever CubeMX is generated.
2020-06-26 06:27 AM
I added this to the wish list thread:
https://community.st.com/s/question/0D53W00000A1WW9SAN/touchgfx-wish-list
2020-06-29 01:51 AM
Hi Scott,
The TouchGFXHAL.cpp file is one big user code section and you can do what you please here. We didn't want to plaster TouchGFXGeneratedHAL.cpp with user code sections like you see in main.c.
For instance, if you want something to be different in your TouchGFX setup simply write that in
void TouchGFXHAL::initialize()
{
TouchGFXGeneratedHAL::initialize();
//your own code here
}
2020-06-29 06:01 AM
Thanks for the reply @Martin KJELDSEN .
I assume what you are saying is that I could write my own version of touchgfx_init() and call registerBitmapDatabase() here? These are currently generated and placed in "generated/TouchGFXConfiguration.cpp".
I will look into this. Right now, I have something working (as long as I remember to revert when CubeMX overwrites it when it generates 😉 .
2020-06-29 06:24 AM
I'm saying that in TouchGFXHAL.cpp we implement all the functions from TouchGFXGeneratedHAL and call the super class functions - So they're ready to modify. For TouchGFXHAL::initialize() you can overwrite what is generated inside the TouchGFXGeneratedHAL::initialize() version
/Martin