When dynamic allocation is not enabled, vPortFree is not available. The current code used
vPortFree and this resulted in linker error. This commit removes the use of vPortFree when
dynamic allocation is not enabled.
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2631
1d2547de-c912-0410-9cb9-
b8ca96c0e9e2
return pxNewTimer;\r
}\r
\r
return pxNewTimer;\r
}\r
\r
-#endif /* configSUPPORT_STATIC_ALLOCATION */\r
+#endif /* configSUPPORT_DYNAMIC_ALLOCATION */\r
/*-----------------------------------------------------------*/\r
\r
#if( configSUPPORT_STATIC_ALLOCATION == 1 )\r
/*-----------------------------------------------------------*/\r
\r
#if( configSUPPORT_STATIC_ALLOCATION == 1 )\r
break;\r
\r
case tmrCOMMAND_DELETE :\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
- 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
+ /* 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
pxTimer->ucStatus &= ~tmrSTATUS_IS_ACTIVE;\r
}\r
+ #endif /* configSUPPORT_DYNAMIC_ALLOCATION */\r