/*\r
- FreeRTOS V8.2.0 - Copyright (C) 2015 Real Time Engineers Ltd.\r
+ FreeRTOS V8.2.2 - Copyright (C) 2015 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\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
\r
- ***************************************************************************\r
+ ***************************************************************************\r
>>! NOTE: The modification to the GPL is included to allow you to !<<\r
>>! distribute a combined work that includes FreeRTOS without being !<<\r
>>! obliged to provide the source code for proprietary components !<<\r
>>! outside of the FreeRTOS kernel. !<<\r
- ***************************************************************************\r
+ ***************************************************************************\r
\r
FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
***************************************************************************\r
\r
http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading\r
- the FAQ page "My application does not run, what could be wrong?". Have you\r
- defined configASSERT()?\r
+ the FAQ page "My application does not run, what could be wrong?". Have you\r
+ defined configASSERT()?\r
\r
- http://www.FreeRTOS.org/support - In return for receiving this top quality\r
- embedded software for free we request you assist our global community by\r
- participating in the support forum.\r
+ http://www.FreeRTOS.org/support - In return for receiving this top quality\r
+ embedded software for free we request you assist our global community by\r
+ participating in the support forum.\r
\r
- http://www.FreeRTOS.org/training - Investing in training allows your team to\r
- be as productive as possible as early as possible. Now you can receive\r
- FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers\r
- Ltd, and the world's leading authority on the world's leading RTOS.\r
+ http://www.FreeRTOS.org/training - Investing in training allows your team to\r
+ be as productive as possible as early as possible. Now you can receive\r
+ FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers\r
+ Ltd, and the world's leading authority on the world's leading RTOS.\r
\r
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE\r
\r
/* Block sizes must not get too small. */\r
-#define heapMINIMUM_BLOCK_SIZE ( ( size_t ) ( xHeapStructSize * 2 ) )\r
+#define heapMINIMUM_BLOCK_SIZE ( ( size_t ) ( xHeapStructSize << 1 ) )\r
\r
/* Assumes 8bit bytes! */\r
#define heapBITS_PER_BYTE ( ( size_t ) 8 )\r
\r
/* The size of the structure placed at the beginning of each allocated memory\r
block must by correctly byte aligned. */\r
-static const size_t xHeapStructSize = ( ( sizeof( BlockLink_t ) + ( ( ( size_t ) portBYTE_ALIGNMENT_MASK ) - ( size_t ) 1 ) ) & ~( ( size_t ) portBYTE_ALIGNMENT_MASK ) );\r
+static const size_t xHeapStructSize = ( sizeof( BlockLink_t ) + ( ( size_t ) ( portBYTE_ALIGNMENT - 1 ) ) ) & ~( ( size_t ) portBYTE_ALIGNMENT_MASK );\r
\r
/* Create a couple of list links to mark the start and end of the list. */\r
static BlockLink_t xStart, *pxEnd = NULL;\r
cast is used to prevent byte alignment warnings from the\r
compiler. */\r
pxNewBlockLink = ( void * ) ( ( ( uint8_t * ) pxBlock ) + xWantedSize );\r
- configASSERT( ( ( ( uint32_t ) pxNewBlockLink ) & portBYTE_ALIGNMENT_MASK ) == 0 );\r
+ configASSERT( ( ( ( size_t ) pxNewBlockLink ) & portBYTE_ALIGNMENT_MASK ) == 0 );\r
\r
/* Calculate the sizes of two blocks split from the\r
single block. */\r
pxBlock->xBlockSize = xWantedSize;\r
\r
/* Insert the new block into the list of free blocks. */\r
- prvInsertBlockIntoFreeList( ( pxNewBlockLink ) );\r
+ prvInsertBlockIntoFreeList( pxNewBlockLink );\r
}\r
else\r
{\r
{\r
BlockLink_t *pxFirstFreeBlock;\r
uint8_t *pucAlignedHeap;\r
-uint32_t ulAddress;\r
+size_t uxAddress;\r
size_t xTotalHeapSize = configTOTAL_HEAP_SIZE;\r
\r
/* Ensure the heap starts on a correctly aligned boundary. */\r
- ulAddress = ( uint32_t ) ucHeap;\r
+ uxAddress = ( size_t ) ucHeap;\r
\r
- if( ( ulAddress & portBYTE_ALIGNMENT_MASK ) != 0 )\r
+ if( ( uxAddress & portBYTE_ALIGNMENT_MASK ) != 0 )\r
{\r
- ulAddress += ( portBYTE_ALIGNMENT - 1 );\r
- ulAddress &= ~( ( uint32_t ) portBYTE_ALIGNMENT_MASK );\r
- xTotalHeapSize -= ulAddress - ( uint32_t ) ucHeap;\r
+ uxAddress += ( portBYTE_ALIGNMENT - 1 );\r
+ uxAddress &= ~( ( size_t ) portBYTE_ALIGNMENT_MASK );\r
+ xTotalHeapSize -= uxAddress - ( size_t ) ucHeap;\r
}\r
\r
- pucAlignedHeap = ( uint8_t * ) ulAddress;\r
+ pucAlignedHeap = ( uint8_t * ) uxAddress;\r
\r
/* xStart is used to hold a pointer to the first item in the list of free\r
blocks. The void cast is used to prevent compiler warnings. */\r
\r
/* pxEnd is used to mark the end of the list of free blocks and is inserted\r
at the end of the heap space. */\r
- ulAddress = ( ( uint32_t ) pucAlignedHeap ) + xTotalHeapSize;\r
- ulAddress -= xHeapStructSize;\r
- ulAddress &= ~( ( uint32_t ) portBYTE_ALIGNMENT_MASK );\r
- pxEnd = ( void * ) ulAddress;\r
+ uxAddress = ( ( size_t ) pucAlignedHeap ) + xTotalHeapSize;\r
+ uxAddress -= xHeapStructSize;\r
+ uxAddress &= ~( ( size_t ) portBYTE_ALIGNMENT_MASK );\r
+ pxEnd = ( void * ) uxAddress;\r
pxEnd->xBlockSize = 0;\r
pxEnd->pxNextFreeBlock = NULL;\r
\r
/* To start with there is a single free block that is sized to take up the\r
entire heap space, minus the space taken by pxEnd. */\r
pxFirstFreeBlock = ( void * ) pucAlignedHeap;\r
- pxFirstFreeBlock->xBlockSize = ulAddress - ( uint32_t ) pxFirstFreeBlock;\r
+ pxFirstFreeBlock->xBlockSize = uxAddress - ( size_t ) pxFirstFreeBlock;\r
pxFirstFreeBlock->pxNextFreeBlock = pxEnd;\r
\r
/* Only one block exists - and it covers the entire usable heap space. */\r