}\r
/*-----------------------------------------------------------*/\r
\r
-TimerHandle_t xTimerGenericCreate( const char * const pcTimerName, const TickType_t xTimerPeriodInTicks, const UBaseType_t uxAutoReload, void * const pvTimerID, TimerCallbackFunction_t pxCallbackFunction, StaticTimer_t *pxStaticTimer ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
+TimerHandle_t xTimerGenericCreate( const char * const pcTimerName, const TickType_t xTimerPeriodInTicks, const UBaseType_t uxAutoReload, void * const pvTimerID, TimerCallbackFunction_t pxCallbackFunction, StaticTimer_t *pxTimerBuffer ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
{\r
Timer_t *pxNewTimer;\r
\r
{\r
/* If the user passed in a statically allocated timer structure then use\r
it, otherwise allocate the structure dynamically. */\r
- if( pxStaticTimer == NULL )\r
+ if( pxTimerBuffer == NULL )\r
{\r
pxNewTimer = ( Timer_t * ) pvPortMalloc( sizeof( Timer_t ) );\r
}\r
else\r
{\r
- pxNewTimer = ( Timer_t * ) pxStaticTimer;\r
+ pxNewTimer = ( Timer_t * ) pxTimerBuffer;\r
}\r
\r
if( pxNewTimer != NULL )\r
pxNewTimer->pxCallbackFunction = pxCallbackFunction;\r
vListInitialiseItem( &( pxNewTimer->xTimerListItem ) );\r
\r
- if( pxStaticTimer == NULL )\r
+ #if( configSUPPORT_STATIC_ALLOCATION == 1 )\r
{\r
- pxNewTimer->ucStaticallyAllocated = pdFALSE;\r
- }\r
- else\r
- {\r
- pxNewTimer->ucStaticallyAllocated = pdTRUE;\r
+ if( pxTimerBuffer == NULL )\r
+ {\r
+ pxNewTimer->ucStaticallyAllocated = pdFALSE;\r
+ }\r
+ else\r
+ {\r
+ pxNewTimer->ucStaticallyAllocated = pdTRUE;\r
+ }\r
}\r
+ #endif /* configSUPPORT_STATIC_ALLOCATION */\r
\r
traceTIMER_CREATE( pxNewTimer );\r
}\r
/* The timer has already been removed from the active list,\r
just free up the memory if the memory was dynamically\r
allocated. */\r
- if( pxTimer->ucStaticallyAllocated == pdFALSE )\r
+ #if( configSUPPORT_STATIC_ALLOCATION == 1 )\r
{\r
- vPortFree( pxTimer );\r
+ if( pxTimer->ucStaticallyAllocated == pdFALSE )\r
+ {\r
+ vPortFree( pxTimer );\r
+ }\r
+ else\r
+ {\r
+ mtCOVERAGE_TEST_MARKER();\r
+ }\r
}\r
- else\r
+ #else\r
{\r
- mtCOVERAGE_TEST_MARKER();\r
+ vPortFree( pxTimer );\r
}\r
+ #endif /* configSUPPORT_STATIC_ALLOCATION */\r
break;\r
\r
default :\r