Skip to content

Commit

Permalink
freertos - update 10.5.1+ - further minor updates and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
feilipu committed May 4, 2023
1 parent d8f3cac commit 458d99c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions freeRTOS10xx/MemMang/heap_4.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,17 +400,17 @@ static void prvHeapInit( void ) /* PRIVILEGED_FUNCTION */
{
BlockLink_t * pxFirstFreeBlock;
uint8_t * pucAlignedHeap;
size_t uxAddress;
portPOINTER_SIZE_TYPE uxAddress;
size_t xTotalHeapSize = configTOTAL_HEAP_SIZE;

/* Ensure the heap starts on a correctly aligned boundary. */
uxAddress = ( size_t ) ucHeap;
uxAddress = ( portPOINTER_SIZE_TYPE ) ucHeap;

if( ( uxAddress & portBYTE_ALIGNMENT_MASK ) != 0 )
{
uxAddress += ( portBYTE_ALIGNMENT - 1 );
uxAddress &= ~( ( size_t ) portBYTE_ALIGNMENT_MASK );
xTotalHeapSize -= ( size_t ) ( uxAddress - ( size_t ) ucHeap );
uxAddress &= ~( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK );
xTotalHeapSize -= ( size_t ) ( uxAddress - ( portPOINTER_SIZE_TYPE ) ucHeap );
}

pucAlignedHeap = ( uint8_t * ) uxAddress;
Expand All @@ -422,17 +422,17 @@ static void prvHeapInit( void ) /* PRIVILEGED_FUNCTION */

/* pxEnd is used to mark the end of the list of free blocks and is inserted
* at the end of the heap space. */
uxAddress = ( size_t ) ( pucAlignedHeap + xTotalHeapSize );
uxAddress = ( portPOINTER_SIZE_TYPE ) ( pucAlignedHeap + xTotalHeapSize );
uxAddress -= xHeapStructSize;
uxAddress &= ~( ( size_t ) portBYTE_ALIGNMENT_MASK );
uxAddress &= ~( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK );
pxEnd = ( BlockLink_t * ) uxAddress;
pxEnd->xBlockSize = 0;
pxEnd->pxNextFreeBlock = NULL;

/* To start with there is a single free block that is sized to take up the
* entire heap space, minus the space taken by pxEnd. */
pxFirstFreeBlock = ( BlockLink_t * ) pucAlignedHeap;
pxFirstFreeBlock->xBlockSize =( size_t ) (uxAddress - ( size_t ) pxFirstFreeBlock );
pxFirstFreeBlock->xBlockSize = ( size_t ) ( uxAddress - ( portPOINTER_SIZE_TYPE ) pxFirstFreeBlock );
pxFirstFreeBlock->pxNextFreeBlock = pxEnd;

/* Only one block exists - and it covers the entire usable heap space. */
Expand Down
2 changes: 1 addition & 1 deletion freeRTOS10xx/MemMang/heap_5.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* FreeRTOS Kernel <DEVELOPMENT BRANCH>
* FreeRTOS Kernel V10.5.1+
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
Expand Down

0 comments on commit 458d99c

Please sign in to comment.