philpem wrote on Wednesday, August 14, 2013:
Hi,
There appears to be a bug in FreeRTOS 7.5.2’s tasks.c.
If a FreeRTOS application enables runtime statistics and defines the portALT_GET_RUN_TIME_COUNTER_VALUE macro but does not provide the portGET_RUN_TIME_COUNTER_VALUE function, tasks.c will fail to link (or possibly fail to compile at all, depending on compiler warning/error promotion options).
To fix this, replace the following code block in tasks.c:
#if ( configGENERATE_RUN_TIME_STATS == 1)
{
if( pulTotalRunTime != NULL )
{
*pulTotalRunTime = portGET_RUN_TIME_COUNTER_VALUE();
}
}
#else
With this:
#if ( configGENERATE_RUN_TIME_STATS == 1)
{
if( pulTotalRunTime != NULL )
{
#ifdef portALT_GET_RUN_TIME_COUNTER_VALUE
portALT_GET_RUN_TIME_COUNTER_VALUE( *pulTotalRunTime );
#else
*pulTotalRunTime = portGET_RUN_TIME_COUNTER_VALUE();
#endif
}
}
#else
Thanks,
Phil.