Hello,
I notice that I'm not the only one on the forum that is using C++ for our code, but having to use HalCoGen code generated as C and H files.
Problems I've encountered to date are.
1. typedefs variable size are different when compiled with C vs C++ compiler (e.g. boolean, bool)
2. pragmas are different for C, C++.
Both of these could be easily resolved if I could compile the HalCoGen files as .cpp files (compiler option -cpp_default). Currently doing so results in errors for the pragmas as they are only coded in C style.
So, my suggestion is to modify the output of HalCoGen so that you provide both versions of pragmas - C and C++
For example,
#ifdef __cplusplus
#pragma CODE_STATE(32)
#pragma INTERRUPT(IRQ)
#else
#pragma CODE_STATE(spi2HighLevelInterrupt, 32)
#pragma INTERRUPT(spi2HighLevelInterrupt, IRQ)
#endif