Remove inline function from timers.h

Inline function converted to macro. This should now build when
optimizations are off and inlining is disabled.
This commit is contained in:
Michael Bruno 2021-01-20 11:57:34 -05:00
parent a7e29d3b98
commit 5644234153

View file

@ -1314,10 +1314,10 @@ TickType_t xTimerGetExpiryTime( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;
BaseType_t xTimerCreateTimerTask( void ) PRIVILEGED_FUNCTION; BaseType_t xTimerCreateTimerTask( void ) PRIVILEGED_FUNCTION;
/* /*
* Splitting the xTimerGenericCommand into two sub functions and making it an * Splitting the xTimerGenericCommand into two sub functions and making it a macro
* inline function removes a recursion path when called from ISRs. This is * removes a recursion path when called from ISRs. This is primarily for the XCore
* primarily for the xCORE XCC port which detects the recursion path and throws * XCC port which detects the recursion path and throws an error during compilation
* an error during compilation when this is not split. * when this is not split.
*/ */
BaseType_t xTimerGenericCommandFromTask( TimerHandle_t xTimer, BaseType_t xTimerGenericCommandFromTask( TimerHandle_t xTimer,
const BaseType_t xCommandID, const BaseType_t xCommandID,
@ -1331,24 +1331,10 @@ BaseType_t xTimerGenericCommandFromISR( TimerHandle_t xTimer,
BaseType_t * const pxHigherPriorityTaskWoken, BaseType_t * const pxHigherPriorityTaskWoken,
const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION; const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
inline BaseType_t xTimerGenericCommand( TimerHandle_t xTimer, #define xTimerGenericCommand( xTimer, xCommandID, xOptionalValue, pxHigherPriorityTaskWoken, xTicksToWait ) \
const BaseType_t xCommandID, ( ( xCommandID ) < tmrFIRST_FROM_ISR_COMMAND ? \
const TickType_t xOptionalValue, xTimerGenericCommandFromTask( xTimer, xCommandID, xOptionalValue, pxHigherPriorityTaskWoken, xTicksToWait ) : \
BaseType_t * const pxHigherPriorityTaskWoken, xTimerGenericCommandFromISR( xTimer, xCommandID, xOptionalValue, pxHigherPriorityTaskWoken, xTicksToWait ) )
const TickType_t xTicksToWait )
{
BaseType_t xReturn;
if( xCommandID < tmrFIRST_FROM_ISR_COMMAND )
{
xReturn = xTimerGenericCommandFromTask( xTimer, xCommandID, xOptionalValue, pxHigherPriorityTaskWoken, xTicksToWait );
}
else
{
xReturn = xTimerGenericCommandFromISR( xTimer, xCommandID, xOptionalValue, pxHigherPriorityTaskWoken, xTicksToWait );
}
return xReturn;
}
#if ( configUSE_TRACE_FACILITY == 1 ) #if ( configUSE_TRACE_FACILITY == 1 )
void vTimerSetTimerNumber( TimerHandle_t xTimer, void vTimerSetTimerNumber( TimerHandle_t xTimer,