Hi!
I would like to use HalCoGen (04.02) and CCS 6.0.1 tools to make a c++ appliation.
When looking at the generated code it gives the impression it works with c++ because there are "#ifdef __cplusplus" in the code. But it's very inconsitant. Some generated files are missing the
#ifdef __cplusplus
extern "C" {
#endif
....
#ifdef __cplusplus
}
#endif
I also found that some files (adc.h) is missing closing "}" at the end because the final #ifdef __cplusplus is missing:
#ifdef __cplusplus
}
#endif
It's also very anoying that the pragmas isn't compatible with c++, the HalCoHen team has to make each pragma compatible by adding something like
#ifdef __cplusplus
#pragma INTERRUPT(IRQ)
#else
#pragma INTERRUPT(phantomInterrupt, IRQ)
#endif
OR add USER CODE BEGIN/END around each pragma so that users can modify the pragmas so that they won't be overwritten the next time the code is generated.
Another problem is when the generated c files are renamed to cpp. HalCoGen needs to check also for cpp files. If I rename a .c file to .cpp I would like HalCoGen to look for the .cpp file before creating a new .c file.
I intend to use the generated HalCoGen code in a IEC61508 SIL application. The generated code has to compile without errors to give the HalCoGen some credibillity to be used in safety-critical development.
PLEASE make a working example (application note would be great) of how to best add c++ to a project using HalCoGen. Both with and without FreeRTOS (there are some fixes to be made in the FreeRTOS port as well I belive). I found others on this forum also having trouble.
Best Regards
Henrik Liljedahl