#define configADJUSTED_HEAP_SIZE ( configTOTAL_HEAP_SIZE - portBYTE_ALIGNMENT )\r
\r
/* Allocate the memory for the heap. */\r
-static uint8_t ucHeap[ configTOTAL_HEAP_SIZE ];\r
+/* Allocate the memory for the heap. */\r
+#if( configAPPLICATION_ALLOCATED_HEAP == 1 )\r
+ /* The application writer has already defined the array used for the RTOS\r
+ heap - probably so it can be placed in a special segment or address. */\r
+ extern uint8_t ucHeap[ configTOTAL_HEAP_SIZE ];\r
+#else\r
+ static uint8_t ucHeap[ configTOTAL_HEAP_SIZE ];\r
+#endif /* configAPPLICATION_ALLOCATED_HEAP */\r
+\r
static size_t xNextFreeByte = ( size_t ) 0;\r
\r
/*-----------------------------------------------------------*/\r
static uint8_t *pucAlignedHeap = NULL;\r
\r
/* Ensure that blocks are always aligned to the required number of bytes. */\r
- #if portBYTE_ALIGNMENT != 1\r
+ #if( portBYTE_ALIGNMENT != 1 )\r
+ {\r
if( xWantedSize & portBYTE_ALIGNMENT_MASK )\r
{\r
/* Byte alignment required. */\r
xWantedSize += ( portBYTE_ALIGNMENT - ( xWantedSize & portBYTE_ALIGNMENT_MASK ) );\r
}\r
+ }\r
#endif\r
\r
vTaskSuspendAll();\r