/*\r
- FreeRTOS V8.2.1 - Copyright (C) 2015 Real Time Engineers Ltd.\r
+ FreeRTOS V9.0.0rc2 - Copyright (C) 2016 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
\r
FreeRTOS is free software; you can redistribute it and/or modify it under\r
the terms of the GNU General Public License (version 2) as published by the\r
- Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.\r
+ Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.\r
\r
***************************************************************************\r
>>! NOTE: The modification to the GPL is included to allow you to !<<\r
\r
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE\r
\r
+#if( configSUPPORT_DYNAMIC_ALLOCATION == 0 )\r
+ #error This file must not be used if configSUPPORT_DYNAMIC_ALLOCATION is 0\r
+#endif\r
+\r
/* A few bytes might be lost to byte aligning the heap start address. */\r
#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