Commit da966da5 authored by Andreas Werner's avatar Andreas Werner
Browse files

Update Files to orinal FreeRTOS Files

Update of FreeRTOS is simpler if Driver Subsystem used FreeRTOSConfig to transform configs
parent 24a52087
......@@ -81,7 +81,7 @@ menu "Basic Settings"
heap_2.c is suitable for most small real time systems that have to dynamically create tasks.
config HEAP_3
bool "Heap 3"
depends on NEWLIB_MALLOC
depends on MACH_HAS_MALLOC || NEWLIB_MALLOC
help
This implements a simple wrapper for the standard C library malloc() and free() functions that will, in most cases, be
supplied with your chosen compiler. The wrapper simply makes the malloc() and free() functions thread safe.
......@@ -211,7 +211,9 @@ menu "Basic Settings"
when a 16bit counter is used is 262 seconds, compared to 17179869 seconds when using a 32bit counter.
comment "Warning the most architecture do not support tick rate garter then 1000Hz"
depends on TICK_RATE_HZ > 1000
comment "Warning tick rate grater then 1000Hz can make the system unstable"
depends on TICK_RATE_HZ > 1000
config TICK_RATE_HZ
int "Scheduler Tick Rate(Hz)"
default 1000
......@@ -433,6 +435,7 @@ menu "Task Setting"
Set to y if you want use Task Tags. Used by Trace Hook Macros
config USE_NEWLIB_REENTRANT
bool "Use Newlib reentrat"
depends on NEWLIB
help
If configUSE_NEWLIB_REENTRANT is set to 1 then a newlib reent structure will be allocated for each created task.
Note Newlib support has been included by popular demand, but is not used by the FreeRTOS maintainers themselves.
......
......@@ -38,7 +38,7 @@
http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading
the FAQ page "My application does not run, what could be wrong?". Have you
defined CONFIG_ASSERT()?
defined configASSERT()?
http://www.FreeRTOS.org/support - In return for receiving this top quality
embedded software for free we request you assist our global community by
......@@ -72,7 +72,7 @@
#include "croutine.h"
/* Remove the whole file is co-routines are not being used. */
#if( CONFIG_USE_CO_ROUTINES != 0 )
#if( configUSE_CO_ROUTINES != 0 )
/*
* Some kernel aware debuggers require data to be viewed to be global, rather
......@@ -84,7 +84,7 @@
/* Lists for ready and blocked co-routines. --------------------*/
static List_t pxReadyCoRoutineLists[ CONFIG_MAX_CO_ROUTINE_PRIORITIES ]; /*< Prioritised ready co-routines. */
static List_t pxReadyCoRoutineLists[ configMAX_CO_ROUTINE_PRIORITIES ]; /*< Prioritised ready co-routines. */
static List_t xDelayedCoRoutineList1; /*< Delayed co-routines. */
static List_t xDelayedCoRoutineList2; /*< Delayed co-routines (two lists are used - one for delays that have overflowed the current tick count. */
static List_t * pxDelayedCoRoutineList; /*< Points to the delayed co-routine list currently being used. */
......@@ -159,9 +159,9 @@ CRCB_t *pxCoRoutine;
}
/* Check the priority is within limits. */
if( uxPriority >= CONFIG_MAX_CO_ROUTINE_PRIORITIES )
if( uxPriority >= configMAX_CO_ROUTINE_PRIORITIES )
{
uxPriority = CONFIG_MAX_CO_ROUTINE_PRIORITIES - 1;
uxPriority = configMAX_CO_ROUTINE_PRIORITIES - 1;
}
/* Fill out the co-routine control block from the function parameters. */
......@@ -181,7 +181,7 @@ CRCB_t *pxCoRoutine;
listSET_LIST_ITEM_OWNER( &( pxCoRoutine->xEventListItem ), pxCoRoutine );
/* Event lists are always in priority order. */
listSET_LIST_ITEM_VALUE( &( pxCoRoutine->xEventListItem ), ( ( TickType_t ) CONFIG_MAX_CO_ROUTINE_PRIORITIES - ( TickType_t ) uxPriority ) );
listSET_LIST_ITEM_VALUE( &( pxCoRoutine->xEventListItem ), ( ( TickType_t ) configMAX_CO_ROUTINE_PRIORITIES - ( TickType_t ) uxPriority ) );
/* Now the co-routine has been initialised it can be added to the ready
list at the correct priority. */
......@@ -351,7 +351,7 @@ static void prvInitialiseCoRoutineLists( void )
{
UBaseType_t uxPriority;
for( uxPriority = 0; uxPriority < CONFIG_MAX_CO_ROUTINE_PRIORITIES; uxPriority++ )
for( uxPriority = 0; uxPriority < configMAX_CO_ROUTINE_PRIORITIES; uxPriority++ )
{
vListInitialise( ( List_t * ) &( pxReadyCoRoutineLists[ uxPriority ] ) );
}
......@@ -391,5 +391,5 @@ BaseType_t xReturn;
return xReturn;
}
#endif /* CONFIG_USE_CO_ROUTINES == 0 */
#endif /* configUSE_CO_ROUTINES == 0 */
......@@ -38,7 +38,7 @@
http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading
the FAQ page "My application does not run, what could be wrong?". Have you
defined CONFIG_ASSERT()?
defined configASSERT()?
http://www.FreeRTOS.org/support - In return for receiving this top quality
embedded software for free we request you assist our global community by
......@@ -70,10 +70,10 @@
/* Standard includes. */
#include <stdlib.h>
/* Defining MPU_WRAPPERS_CONFIG_INCLUDED_FROM_API_FILE prevents task.h from redefining
/* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining
all the API functions to use the MPU wrappers. That should only be done when
task.h is included from an application file. */
#define MPU_WRAPPERS_CONFIG_INCLUDED_FROM_API_FILE
#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
/* FreeRTOS includes. */
#include "FreeRTOS.h"
......@@ -82,23 +82,23 @@ task.h is included from an application file. */
#include "event_groups.h"
/* Lint e961 and e750 are suppressed as a MISRA exception justified because the
MPU ports require MPU_WRAPPERS_CONFIG_INCLUDED_FROM_API_FILE to be defined for the
MPU ports require MPU_WRAPPERS_INCLUDED_FROM_API_FILE to be defined for the
header files above, but not in this file, in order to generate the correct
privileged Vs unprivileged linkage and placement. */
#undef MPU_WRAPPERS_CONFIG_INCLUDED_FROM_API_FILE /*lint !e961 !e750. */
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE /*lint !e961 !e750. */
#if ( CONFIG_INCLUDE_xEventGroupSetBitFromISR == 1 ) && ( CONFIG_USE_TIMERS == 0 )
#error CONFIG_USE_TIMERS must be set to 1 to make the xEventGroupSetBitFromISR() function available.
#if ( INCLUDE_xEventGroupSetBitFromISR == 1 ) && ( configUSE_TIMERS == 0 )
#error configUSE_TIMERS must be set to 1 to make the xEventGroupSetBitFromISR() function available.
#endif
#if ( CONFIG_INCLUDE_xEventGroupSetBitFromISR == 1 ) && ( CONFIG_INCLUDE_xTimerPendFunctionCall == 0 )
#error CONFIG_INCLUDE_xTimerPendFunctionCall must also be set to one to make the xEventGroupSetBitFromISR() function available.
#if ( INCLUDE_xEventGroupSetBitFromISR == 1 ) && ( INCLUDE_xTimerPendFunctionCall == 0 )
#error INCLUDE_xTimerPendFunctionCall must also be set to one to make the xEventGroupSetBitFromISR() function available.
#endif
/* The following bit fields convey control information in a task's event list
item value. It is important they don't clash with the
taskEVENT_LIST_ITEM_VALUE_IN_USE definition. */
#if CONFIG_USE_16_BIT_TICKS == 1
#if configUSE_16_BIT_TICKS == 1
#define eventCLEAR_EVENTS_ON_EXIT_BIT 0x0100U
#define eventUNBLOCKED_DUE_TO_BIT_SET 0x0200U
#define eventWAIT_FOR_ALL_BITS 0x0400U
......@@ -115,7 +115,7 @@ typedef struct xEventGroupDefinition
EventBits_t uxEventBits;
List_t xTasksWaitingForBits; /*< List of tasks waiting for a bit to be set. */
#if( CONFIG_USE_TRACE_FACILITY == 1 )
#if( configUSE_TRACE_FACILITY == 1 )
UBaseType_t uxEventGroupNumber;
#endif
......@@ -162,11 +162,11 @@ EventGroup_t *pxEventBits = ( EventGroup_t * ) xEventGroup;
BaseType_t xAlreadyYielded;
BaseType_t xTimeoutOccurred = pdFALSE;
CONFIG_ASSERT( ( uxBitsToWaitFor & eventEVENT_BITS_CONTROL_BYTES ) == 0 );
CONFIG_ASSERT( uxBitsToWaitFor != 0 );
#if ( ( CONFIG_INCLUDE_xTaskGetSchedulerState == 1 ) || ( CONFIG_USE_TIMERS == 1 ) )
configASSERT( ( uxBitsToWaitFor & eventEVENT_BITS_CONTROL_BYTES ) == 0 );
configASSERT( uxBitsToWaitFor != 0 );
#if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
{
CONFIG_ASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );
configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );
}
#endif
......@@ -280,12 +280,12 @@ BaseType_t xTimeoutOccurred = pdFALSE;
/* Check the user is not attempting to wait on the bits used by the kernel
itself, and that at least one bit is being requested. */
CONFIG_ASSERT( xEventGroup );
CONFIG_ASSERT( ( uxBitsToWaitFor & eventEVENT_BITS_CONTROL_BYTES ) == 0 );
CONFIG_ASSERT( uxBitsToWaitFor != 0 );
#if ( ( CONFIG_INCLUDE_xTaskGetSchedulerState == 1 ) || ( CONFIG_USE_TIMERS == 1 ) )
configASSERT( xEventGroup );
configASSERT( ( uxBitsToWaitFor & eventEVENT_BITS_CONTROL_BYTES ) == 0 );
configASSERT( uxBitsToWaitFor != 0 );
#if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
{
CONFIG_ASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );
configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );
}
#endif
......@@ -426,8 +426,8 @@ EventBits_t uxReturn;
/* Check the user is not attempting to clear the bits used by the kernel
itself. */
CONFIG_ASSERT( xEventGroup );
CONFIG_ASSERT( ( uxBitsToClear & eventEVENT_BITS_CONTROL_BYTES ) == 0 );
configASSERT( xEventGroup );
configASSERT( ( uxBitsToClear & eventEVENT_BITS_CONTROL_BYTES ) == 0 );
taskENTER_CRITICAL();
{
......@@ -446,7 +446,7 @@ EventBits_t uxReturn;
}
/*-----------------------------------------------------------*/
#if ( ( CONFIG_USE_TRACE_FACILITY == 1 ) && ( CONFIG_INCLUDE_xTimerPendFunctionCall == 1 ) && ( CONFIG_USE_TIMERS == 1 ) )
#if ( ( configUSE_TRACE_FACILITY == 1 ) && ( INCLUDE_xTimerPendFunctionCall == 1 ) && ( configUSE_TIMERS == 1 ) )
BaseType_t xEventGroupClearBitsFromISR( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToClear )
{
......@@ -488,8 +488,8 @@ BaseType_t xMatchFound = pdFALSE;
/* Check the user is not attempting to set the bits used by the kernel
itself. */
CONFIG_ASSERT( xEventGroup );
CONFIG_ASSERT( ( uxBitsToSet & eventEVENT_BITS_CONTROL_BYTES ) == 0 );
configASSERT( xEventGroup );
configASSERT( ( uxBitsToSet & eventEVENT_BITS_CONTROL_BYTES ) == 0 );
pxList = &( pxEventBits->xTasksWaitingForBits );
pxListEnd = listGET_END_MARKER( pxList ); /*lint !e826 !e740 The mini list structure is used as the list end to save RAM. This is checked and valid. */
......@@ -584,7 +584,7 @@ const List_t *pxTasksWaitingForBits = &( pxEventBits->xTasksWaitingForBits );
{
/* Unblock the task, returning 0 as the event list is being deleted
and cannot therefore have any bits set. */
CONFIG_ASSERT( pxTasksWaitingForBits->xListEnd.pxNext != ( ListItem_t * ) &( pxTasksWaitingForBits->xListEnd ) );
configASSERT( pxTasksWaitingForBits->xListEnd.pxNext != ( ListItem_t * ) &( pxTasksWaitingForBits->xListEnd ) );
( void ) xTaskRemoveFromUnorderedEventList( pxTasksWaitingForBits->xListEnd.pxNext, eventUNBLOCKED_DUE_TO_BIT_SET );
}
......@@ -645,7 +645,7 @@ BaseType_t xWaitConditionMet = pdFALSE;
}
/*-----------------------------------------------------------*/
#if ( ( CONFIG_USE_TRACE_FACILITY == 1 ) && ( CONFIG_INCLUDE_xTimerPendFunctionCall == 1 ) && ( CONFIG_USE_TIMERS == 1 ) )
#if ( ( configUSE_TRACE_FACILITY == 1 ) && ( INCLUDE_xTimerPendFunctionCall == 1 ) && ( configUSE_TIMERS == 1 ) )
BaseType_t xEventGroupSetBitsFromISR( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet, BaseType_t *pxHigherPriorityTaskWoken )
{
......@@ -660,7 +660,7 @@ BaseType_t xWaitConditionMet = pdFALSE;
#endif
/*-----------------------------------------------------------*/
#if (CONFIG_USE_TRACE_FACILITY == 1)
#if (configUSE_TRACE_FACILITY == 1)
UBaseType_t uxEventGroupGetNumber( void* xEventGroup )
{
......
......@@ -38,7 +38,7 @@
http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading
the FAQ page "My application does not run, what could be wrong?". Have you
defined CONFIG_ASSERT()?
defined configASSERT()?
http://www.FreeRTOS.org/support - In return for receiving this top quality
embedded software for free we request you assist our global community by
......@@ -77,21 +77,21 @@
*/
#include <stdlib.h>
/* Defining MPU_WRAPPERS_CONFIG_INCLUDED_FROM_API_FILE prevents task.h from redefining
/* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining
all the API functions to use the MPU wrappers. That should only be done when
task.h is included from an application file. */
#define MPU_WRAPPERS_CONFIG_INCLUDED_FROM_API_FILE
#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
#include "FreeRTOS.h"
#include "task.h"
#undef MPU_WRAPPERS_CONFIG_INCLUDED_FROM_API_FILE
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
/* A few bytes might be lost to byte aligning the heap start address. */
#define CONFIG_ADJUSTED_HEAP_SIZE ( CONFIG_TOTAL_HEAP_SIZE - portBYTE_ALIGNMENT )
#define configADJUSTED_HEAP_SIZE ( configTOTAL_HEAP_SIZE - portBYTE_ALIGNMENT )
/* Allocate the memory for the heap. */
static uint8_t ucHeap[ CONFIG_TOTAL_HEAP_SIZE ];
static uint8_t ucHeap[ configTOTAL_HEAP_SIZE ];
static size_t xNextFreeByte = ( size_t ) 0;
/*-----------------------------------------------------------*/
......@@ -119,7 +119,7 @@ static uint8_t *pucAlignedHeap = NULL;
}
/* Check there is enough room left for the allocation. */
if( ( ( xNextFreeByte + xWantedSize ) < CONFIG_ADJUSTED_HEAP_SIZE ) &&
if( ( ( xNextFreeByte + xWantedSize ) < configADJUSTED_HEAP_SIZE ) &&
( ( xNextFreeByte + xWantedSize ) > xNextFreeByte ) )/* Check for overflow. */
{
/* Return the next free byte then increment the index past this
......@@ -132,7 +132,7 @@ static uint8_t *pucAlignedHeap = NULL;
}
( void ) xTaskResumeAll();
#if( CONFIG_USE_MALLOC_FAILED_HOOK == 1 )
#if( configUSE_MALLOC_FAILED_HOOK == 1 )
{
if( pvReturn == NULL )
{
......@@ -154,7 +154,7 @@ void vPortFree( void *pv )
( void ) pv;
/* Force an assert as it is invalid to call this function. */
CONFIG_ASSERT( pv == NULL );
configASSERT( pv == NULL );
}
/*-----------------------------------------------------------*/
......@@ -167,7 +167,7 @@ void vPortInitialiseBlocks( void )
size_t xPortGetFreeHeapSize( void )
{
return ( CONFIG_ADJUSTED_HEAP_SIZE - xNextFreeByte );
return ( configADJUSTED_HEAP_SIZE - xNextFreeByte );
}
......
......@@ -38,7 +38,7 @@
http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading
the FAQ page "My application does not run, what could be wrong?". Have you
defined CONFIG_ASSERT()?
defined configASSERT()?
http://www.FreeRTOS.org/support - In return for receiving this top quality
embedded software for free we request you assist our global community by
......@@ -78,18 +78,18 @@
*/
#include <stdlib.h>
/* Defining MPU_WRAPPERS_CONFIG_INCLUDED_FROM_API_FILE prevents task.h from redefining
/* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining
all the API functions to use the MPU wrappers. That should only be done when
task.h is included from an application file. */
#define MPU_WRAPPERS_CONFIG_INCLUDED_FROM_API_FILE
#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
#include "FreeRTOS.h"
#include "task.h"
#undef MPU_WRAPPERS_CONFIG_INCLUDED_FROM_API_FILE
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
/* A few bytes might be lost to byte aligning the heap start address. */
#define CONFIG_ADJUSTED_HEAP_SIZE ( CONFIG_TOTAL_HEAP_SIZE - portBYTE_ALIGNMENT )
#define configADJUSTED_HEAP_SIZE ( configTOTAL_HEAP_SIZE - portBYTE_ALIGNMENT )
/*
* Initialises the heap structures before their first use.
......@@ -97,7 +97,7 @@ task.h is included from an application file. */
static void prvHeapInit( void );
/* Allocate the memory for the heap. */
static uint8_t ucHeap[ CONFIG_TOTAL_HEAP_SIZE ];
static uint8_t ucHeap[ configTOTAL_HEAP_SIZE ];
/* Define the linked list structure. This is used to link free blocks in order
of their size. */
......@@ -116,7 +116,7 @@ static BlockLink_t xStart, xEnd;
/* Keeps track of the number of free bytes remaining, but says nothing about
fragmentation. */
static size_t xFreeBytesRemaining = CONFIG_ADJUSTED_HEAP_SIZE;
static size_t xFreeBytesRemaining = configADJUSTED_HEAP_SIZE;
/* STATIC FUNCTIONS ARE DEFINED AS MACROS TO MINIMIZE THE FUNCTION CALL DEPTH. */
......@@ -176,7 +176,7 @@ void *pvReturn = NULL;
}
}
if( ( xWantedSize > 0 ) && ( xWantedSize < CONFIG_ADJUSTED_HEAP_SIZE ) )
if( ( xWantedSize > 0 ) && ( xWantedSize < configADJUSTED_HEAP_SIZE ) )
{
/* Blocks are stored in byte order - traverse the list from the start
(smallest) block until one of adequate size is found. */
......@@ -224,7 +224,7 @@ void *pvReturn = NULL;
}
( void ) xTaskResumeAll();
#if( CONFIG_USE_MALLOC_FAILED_HOOK == 1 )
#if( configUSE_MALLOC_FAILED_HOOK == 1 )
{
if( pvReturn == NULL )
{
......@@ -291,13 +291,13 @@ uint8_t *pucAlignedHeap;
xStart.xBlockSize = ( size_t ) 0;
/* xEnd is used to mark the end of the list of free blocks. */
xEnd.xBlockSize = CONFIG_ADJUSTED_HEAP_SIZE;
xEnd.xBlockSize = configADJUSTED_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 * ) pucAlignedHeap;
pxFirstFreeBlock->xBlockSize = CONFIG_ADJUSTED_HEAP_SIZE;
pxFirstFreeBlock->xBlockSize = configADJUSTED_HEAP_SIZE;
pxFirstFreeBlock->pxNextFreeBlock = &xEnd;
}
/*-----------------------------------------------------------*/
......@@ -38,7 +38,7 @@
http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading
the FAQ page "My application does not run, what could be wrong?". Have you
defined CONFIG_ASSERT()?
defined configASSERT()?
http://www.FreeRTOS.org/support - In return for receiving this top quality
embedded software for free we request you assist our global community by
......@@ -72,7 +72,7 @@
* Implementation of pvPortMalloc() and vPortFree() that relies on the
* compilers own malloc() and free() implementations.
*
* This file can only be used if the linker is CONFIG_ured to to generate
* This file can only be used if the linker is configured to to generate
* a heap memory area.
*
* See heap_1.c, heap_2.c and heap_4.c for alternative implementations, and the
......@@ -81,15 +81,15 @@
#include <stdlib.h>
/* Defining MPU_WRAPPERS_CONFIG_INCLUDED_FROM_API_FILE prevents task.h from redefining
/* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining
all the API functions to use the MPU wrappers. That should only be done when
task.h is included from an application file. */
#define MPU_WRAPPERS_CONFIG_INCLUDED_FROM_API_FILE
#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
#include "FreeRTOS.h"
#include "task.h"
#undef MPU_WRAPPERS_CONFIG_INCLUDED_FROM_API_FILE
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
/*-----------------------------------------------------------*/
......@@ -104,7 +104,7 @@ void *pvReturn;
}
( void ) xTaskResumeAll();
#if( CONFIG_USE_MALLOC_FAILED_HOOK == 1 )
#if( configUSE_MALLOC_FAILED_HOOK == 1 )
{
if( pvReturn == NULL )
{
......
......@@ -38,7 +38,7 @@
http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading
the FAQ page "My application does not run, what could be wrong?". Have you
defined CONFIG_ASSERT()?
defined configASSERT()?
http://www.FreeRTOS.org/support - In return for receiving this top quality
embedded software for free we request you assist our global community by
......@@ -77,15 +77,15 @@
*/
#include <stdlib.h>
/* Defining MPU_WRAPPERS_CONFIG_INCLUDED_FROM_API_FILE prevents task.h from redefining
/* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining
all the API functions to use the MPU wrappers. That should only be done when
task.h is included from an application file. */
#define MPU_WRAPPERS_CONFIG_INCLUDED_FROM_API_FILE
#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
#include "FreeRTOS.h"
#include "task.h"
#undef MPU_WRAPPERS_CONFIG_INCLUDED_FROM_API_FILE
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
/* Block sizes must not get too small. */
#define heapMINIMUM_BLOCK_SIZE ( ( size_t ) ( xHeapStructSize << 1 ) )
......@@ -94,13 +94,13 @@ task.h is included from an application file. */
#define heapBITS_PER_BYTE ( ( size_t ) 8 )
/* Allocate the memory for the heap. */
#if( CONFIG_APPLICATION_ALLOCATED_HEAP == 1 )
#if( configAPPLICATION_ALLOCATED_HEAP == 1 )
/* The application writer has already defined the array used for the RTOS
heap - probably so it can be placed in a special segment or address. */
extern uint8_t ucHeap[ CONFIG_TOTAL_HEAP_SIZE ];
extern uint8_t ucHeap[ configTOTAL_HEAP_SIZE ];
#else
static uint8_t ucHeap[ CONFIG_TOTAL_HEAP_SIZE ];
#endif /* CONFIG_APPLICATION_ALLOCATED_HEAP */
static uint8_t ucHeap[ configTOTAL_HEAP_SIZE ];
#endif /* configAPPLICATION_ALLOCATED_HEAP */
/* Define the linked list structure. This is used to link free blocks in order
of their memory address. */
......@@ -184,7 +184,7 @@ void *pvReturn = NULL;
{
/* Byte alignment required. */
xWantedSize += ( portBYTE_ALIGNMENT - ( xWantedSize & portBYTE_ALIGNMENT_MASK ) );
CONFIG_ASSERT( ( xWantedSize & portBYTE_ALIGNMENT_MASK ) == 0 );
configASSERT( ( xWantedSize & portBYTE_ALIGNMENT_MASK ) == 0 );
}
else
{
......@@ -229,7 +229,7 @@ void *pvReturn = NULL;
cast is used to prevent byte alignment warnings from the
compiler. */
pxNewBlockLink = ( void * ) ( ( ( uint8_t * ) pxBlock ) + xWantedSize );
CONFIG_ASSERT( ( ( ( size_t ) pxNewBlockLink ) & portBYTE_ALIGNMENT_MASK ) == 0 );
configASSERT( ( ( ( size_t ) pxNewBlockLink ) & portBYTE_ALIGNMENT_MASK ) == 0 );
/* Calculate the sizes of two blocks split from the
single block. */
......@@ -279,7 +279,7 @@ void *pvReturn = NULL;
}
( void ) xTaskResumeAll();
#if( CONFIG_USE_MALLOC_FAILED_HOOK == 1 )
#if( configUSE_MALLOC_FAILED_HOOK == 1 )
{
if( pvReturn == NULL )
{
......@@ -293,7 +293,7 @@ void *pvReturn = NULL;
}
#endif
CONFIG_ASSERT( ( ( ( uint32_t ) pvReturn ) & portBYTE_ALIGNMENT_MASK ) == 0 );
configASSERT( ( ( ( uint32_t ) pvReturn ) & portBYTE_ALIGNMENT_MASK ) == 0 );
return pvReturn;
}
/*-----------------------------------------------------------*/
......@@ -313,8 +313,8 @@ BlockLink_t *pxLink;
pxLink = ( void * ) puc;
/* Check the block is actually allocated. */
CONFIG_ASSERT( ( pxLink->xBlockSize & xBlockAllocatedBit ) != 0 );
CONFIG_ASSERT( pxLink->pxNextFreeBlock == NULL );
configASSERT( ( pxLink->xBlockSize & xBlockAllocatedBit ) != 0 );
configASSERT( pxLink->pxNextFreeBlock == NULL );
if( ( pxLink->xBlockSize & xBlockAllocatedBit ) != 0 )
{
......@@ -369,7 +369,7 @@ static void prvHeapInit( void )
BlockLink_t *pxFirstFreeBlock;
uint8_t *pucAlignedHeap;
size_t uxAddress;
size_t xTotalHeapSize = CONFIG_TOTAL_HEAP_SIZE;
size_t xTotalHeapSize = configTOTAL_HEAP_SIZE;
/* Ensure the heap starts on a correctly aligned boundary. */
uxAddress = ( size_t ) ucHeap;
......
......@@ -38,7 +38,7 @@
http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading
the FAQ page "My application does not run, what could be wrong?". Have you
defined CONFIG_ASSERT()?
defined configASSERT()?
http://www.FreeRTOS.org/support - In return for receiving this top quality
embedded software for free we request you assist our global community by
......@@ -111,15 +111,15 @@
*/
#include <stdlib.h>
/* Defining MPU_WRAPPERS_CONFIG_INCLUDED_FROM_API_FILE prevents task.h from redefining
/* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining
all the API functions to use the MPU wrappers. That should only be done when
task.h is included from an application file. */
#define MPU_WRAPPERS_CONFIG_INCLUDED_FROM_API_FILE
#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
#include "FreeRTOS.h"
#include "task.h"
#undef MPU_WRAPPERS_CONFIG_INCLUDED_FROM_API_FILE
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
/* Block sizes must not get too small. */
#define heapMINIMUM_BLOCK_SIZE ( ( size_t ) ( xHeapStructSize << 1 ) )
......@@ -174,7 +174,7 @@ void *pvReturn = NULL;
/* The heap must be initialised before the first call to
prvPortMalloc(). */
CONFIG_ASSERT( pxEnd );
configASSERT( pxEnd );
vTaskSuspendAll();
{
......@@ -289,7 +289,7 @@ void *pvReturn = NULL;
}
( void ) xTaskResumeAll();
#if( CONFIG_USE_MALLOC_FAILED_HOOK == 1 )
#if( configUSE_MALLOC_FAILED_HOOK == 1 )
{
if( pvReturn == NULL )
{
......@@ -322,8 +322,8 @@ BlockLink_t *pxLink;
pxLink = ( void * ) puc;
/* Check the block is actually allocated. */
CONFIG_ASSERT( ( pxLink->xBlockSize & xBlockAllocatedBit ) != 0 );
CONFIG_ASSERT( pxLink->pxNextFreeBlock == NULL );
configASSERT( ( pxLink->xBlockSize & xBlockAllocatedBit ) != 0 );
configASSERT( pxLink->pxNextFreeBlock == NULL );
if( ( pxLink->xBlockSize & xBlockAllocatedBit ) != 0 )
{
......@@ -438,7 +438,7 @@ size_t xAddress;
const HeapRegion_t *pxHeapRegion;
/* Can only call once! */
CONFIG_ASSERT( pxEnd == NULL );
configASSERT( pxEnd == NULL );
pxHeapRegion = &( pxHeapRegions[ xDefinedRegions ] );
......@@ -471,10 +471,10 @@ const HeapRegion_t *pxHeapRegion;
{
/* Should only get here if one region has already been added to the
heap. */
CONFIG_ASSERT( pxEnd != NULL );
configASSERT( pxEnd != NULL );
/* Check blocks are passed in with increasing start addresses. */
CONFIG_ASSERT( xAddress > ( size_t ) pxEnd );
configASSERT( xAddress > ( size_t ) pxEnd );
}
/* Remember the location of the end marker in the previous region, if
......@@ -515,7 +515,7 @@ const HeapRegion_t *pxHeapRegion;
xFreeBytesRemaining = xTotalHeapSize;
/* Check something was actually defined before it is accessed. */
CONFIG_ASSERT( xTotalHeapSize );
configASSERT( xTotalHeapSize );
/* Work out the position of the top bit in a size_t variable. */
xBlockAllocatedBit = ( ( size_t ) 1 ) << ( ( sizeof( size_t ) * heapBITS_PER_BYTE ) - 1 );
......
This diff is collapsed.
......@@ -9,122 +9,367 @@
*
* Add Branch prediction information assert should always not x
*/
# define CONFIG_ASSERT(x) \
# define configASSERT(x) \
do{ \
if(__builtin_expect(!(x), 0)) { \
taskDISABLE_INTERRUPTS(); \
portDISABLE_INTERRUPTS(); \
for(;;); \
} \
}while(0)
#endif
#ifdef CONFIG_ASSERT_USER_DEFINED
# define configASSERT(x) ASSERT_USER(x)
#endif
# define CONFIG_ASSERT(x) configASSERT(x)
#ifdef CONFIG_CHECK_STACK_OVERFLOW
# ifdef CONFIG_CHECK_FOR_STACK_OVERFLOW_1
# define CONFIG_CHECK_FOR_STACK_OVERFLOW 1
# define configCHECK_FOR_STACK_OVERFLOW 1
# endif
# ifdef CONFIG_CHECK_FOR_STACK_OVERFLOW_2
# define CONFIG_CHECK_FOR_STACK_OVERFLOW 2
# define configCHECK_FOR_STACK_OVERFLOW 2
# endif