The debug option inserts calls to the "reportState" functions. The “reportState” functions are placed in a file p_state.c and are called according to the defined “Debug Level”:
cgReportState(unsigned char whichChart, unsigned char*
OSPrintf("Statechart %s ", "INIT_MODE_SC");
if ((((*(StateInfo_INIT_MODE_SC*)baseAddress)) & 0)
OSPrintf("%s", "Chart_INIT_MODE_SC");
if ((((*(StateInfo_INIT_MODE_SC*)baseAddress)) &
OSPrintf("%s", "DefaultOf_Chart_INIT_MODE_SC");
else if ((((*(StateInfo_INIT_MODE_SC*)baseAddress))
OSPrintf("%s", "VOLT_OUT_OF_RANGEst3");
else if ((((*(StateInfo_INIT_MODE_SC*)baseAddress))
Note: OSPrintf is used only in OSEK applications, and outputs to the stdout, which can be redirected. Redefining the OSPrintf function can allow the debug info to be directed anywhere. For Non-OSEK applications, printf is used.