From 9e94f9fee97fffa53b334ad6bed158a551756a77 Mon Sep 17 00:00:00 2001 From: James Cotton Date: Tue, 12 Jul 2011 12:48:06 -0500 Subject: [PATCH] Fix typo from SISE to SIZE --- .../FreeRTOS/Source/portable/MemMang/heap_1.c | 26 +++++++++---------- .../FreeRTOS/Source/portable/MemMang/heap_2.c | 16 ++++++------ 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/portable/MemMang/heap_1.c b/flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/portable/MemMang/heap_1.c index 638dc220a..f3abbb52c 100644 --- a/flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/portable/MemMang/heap_1.c +++ b/flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/portable/MemMang/heap_1.c @@ -1,6 +1,6 @@ /* FreeRTOS V7.0.1 - Copyright (C) 2011 Real Time Engineers Ltd. - + *************************************************************************** * * @@ -79,18 +79,18 @@ static union xRTOS_HEAP volatile portDOUBLE dDummy; #else volatile unsigned long ulDummy; - #endif + #endif unsigned char ucHeap[ configTOTAL_HEAP_SIZE ]; } xHeap __attribute__ ((section (".heap"))); static size_t xNextFreeByte = ( size_t ) 0; -static size_t currentTOTAL_HEAP_SISE = configTOTAL_HEAP_SIZE; +static size_t currentTOTAL_HEAP_SIZE = configTOTAL_HEAP_SIZE; /*-----------------------------------------------------------*/ void *pvPortMalloc( size_t xWantedSize ) { -void *pvReturn = NULL; +void *pvReturn = NULL; /* Ensure that blocks are always aligned to the required number of bytes. */ #if portBYTE_ALIGNMENT != 1 @@ -104,17 +104,17 @@ void *pvReturn = NULL; vTaskSuspendAll(); { /* Check there is enough room left for the allocation. */ - if( ( ( xNextFreeByte + xWantedSize ) < currentTOTAL_HEAP_SISE ) && + if( ( ( xNextFreeByte + xWantedSize ) < currentTOTAL_HEAP_SIZE ) && ( ( xNextFreeByte + xWantedSize ) > xNextFreeByte ) )/* Check for overflow. */ { /* Return the next free byte then increment the index past this block. */ pvReturn = &( xHeap.ucHeap[ xNextFreeByte ] ); - xNextFreeByte += xWantedSize; - } + xNextFreeByte += xWantedSize; + } } xTaskResumeAll(); - + #if( configUSE_MALLOC_FAILED_HOOK == 1 ) { if( pvReturn == NULL ) @@ -123,7 +123,7 @@ void *pvReturn = NULL; vApplicationMallocFailedHook(); } } - #endif + #endif return pvReturn; } @@ -131,8 +131,8 @@ void *pvReturn = NULL; void vPortFree( void *pv ) { - /* Memory cannot be freed using this scheme. See heap_2.c and heap_3.c - for alternative implementations, and the memory management pages of + /* Memory cannot be freed using this scheme. See heap_2.c and heap_3.c + for alternative implementations, and the memory management pages of http://www.FreeRTOS.org for more information. */ ( void ) pv; } @@ -147,14 +147,14 @@ void vPortInitialiseBlocks( void ) size_t xPortGetFreeHeapSize( void ) { - return ( currentTOTAL_HEAP_SISE - xNextFreeByte ); + return ( currentTOTAL_HEAP_SIZE - xNextFreeByte ); } /*-----------------------------------------------------------*/ void xPortIncreaseHeapSize( size_t bytes ) { vTaskSuspendAll(); - currentTOTAL_HEAP_SISE = configTOTAL_HEAP_SIZE + bytes; + currentTOTAL_HEAP_SIZE = configTOTAL_HEAP_SIZE + bytes; xTaskResumeAll(); } /*-----------------------------------------------------------*/ diff --git a/flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/portable/MemMang/heap_2.c b/flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/portable/MemMang/heap_2.c index c361a5aaf..91258edd6 100644 --- a/flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/portable/MemMang/heap_2.c +++ b/flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/portable/MemMang/heap_2.c @@ -1,6 +1,6 @@ /* FreeRTOS V7.0.1 - Copyright (C) 2011 Real Time Engineers Ltd. - + *************************************************************************** * * @@ -101,7 +101,7 @@ static xBlockLink xStart, xEnd; /* Keeps track of the number of free bytes remaining, but says nothing about fragmentation. */ static size_t xFreeBytesRemaining = configTOTAL_HEAP_SIZE; -static size_t currentTOTAL_HEAP_SISE = configTOTAL_HEAP_SIZE; +static size_t currentTOTAL_HEAP_SIZE = configTOTAL_HEAP_SIZE; /* STATIC FUNCTIONS ARE DEFINED AS MACROS TO MINIMIZE THE FUNCTION CALL DEPTH. */ @@ -141,13 +141,13 @@ xBlockLink *pxFirstFreeBlock; \ xStart.xBlockSize = ( size_t ) 0; \ \ /* xEnd is used to mark the end of the list of free blocks. */ \ - xEnd.xBlockSize = currentTOTAL_HEAP_SISE; \ + xEnd.xBlockSize = currentTOTAL_HEAP_SIZE; \ xEnd.pxNextFreeBlock = NULL; \ \ /* To start with there is a single free block that is sized to take up the \ entire heap space. */ \ pxFirstFreeBlock = ( void * ) xHeap.ucHeap; \ - pxFirstFreeBlock->xBlockSize = currentTOTAL_HEAP_SISE; \ + pxFirstFreeBlock->xBlockSize = currentTOTAL_HEAP_SIZE; \ pxFirstFreeBlock->pxNextFreeBlock = &xEnd; \ } /*-----------------------------------------------------------*/ @@ -182,7 +182,7 @@ void *pvReturn = NULL; } } - if( ( xWantedSize > 0 ) && ( xWantedSize < currentTOTAL_HEAP_SISE ) ) + if( ( xWantedSize > 0 ) && ( xWantedSize < currentTOTAL_HEAP_SIZE ) ) { /* Blocks are stored in byte order - traverse the list from the start (smallest) block until one of adequate size is found. */ @@ -221,7 +221,7 @@ void *pvReturn = NULL; /* Insert the new block into the list of free blocks. */ prvInsertBlockIntoFreeList( ( pxNewBlockLink ) ); } - + xFreeBytesRemaining -= pxBlock->xBlockSize; } } @@ -282,8 +282,8 @@ void xPortIncreaseHeapSize( size_t bytes ) { xBlockLink *pxNewBlockLink; vTaskSuspendAll(); - currentTOTAL_HEAP_SISE = configTOTAL_HEAP_SIZE + bytes; - xEnd.xBlockSize = currentTOTAL_HEAP_SISE; + currentTOTAL_HEAP_SIZE = configTOTAL_HEAP_SIZE + bytes; + xEnd.xBlockSize = currentTOTAL_HEAP_SIZE; xFreeBytesRemaining += bytes; /* Insert the new block into the list of free blocks. */ pxNewBlockLink = ( void * ) &xHeap.ucHeap[ configTOTAL_HEAP_SIZE ];