return pxNewTimer;\r
}\r
\r
-#endif /* configSUPPORT_STATIC_ALLOCATION */\r
+#endif /* configSUPPORT_DYNAMIC_ALLOCATION */\r
/*-----------------------------------------------------------*/\r
\r
#if( configSUPPORT_STATIC_ALLOCATION == 1 )\r
break;\r
\r
case tmrCOMMAND_DELETE :\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->ucStatus & tmrSTATUS_IS_STATICALLY_ALLOCATED ) == ( uint8_t ) 0 )\r
+ #if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )\r
{\r
- vPortFree( pxTimer );\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->ucStatus & tmrSTATUS_IS_STATICALLY_ALLOCATED ) == ( uint8_t ) 0 )\r
+ {\r
+ vPortFree( pxTimer );\r
+ }\r
+ else\r
+ {\r
+ pxTimer->ucStatus &= ~tmrSTATUS_IS_ACTIVE;\r
+ }\r
}\r
- else\r
+ #else\r
{\r
+ /* If dynamic allocation is not enabled, the memory\r
+ could not have been dynamically allocated. So there is\r
+ no need to free the memory - just mark the timer as\r
+ "not active". */\r
pxTimer->ucStatus &= ~tmrSTATUS_IS_ACTIVE;\r
}\r
+ #endif /* configSUPPORT_DYNAMIC_ALLOCATION */\r
break;\r
\r
default :\r