* THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE\r
* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.\r
*\r
- * See http://www.freertos.org/a00110.html.\r
+ * See http://www.freertos.org/a00110.html for a full list of configuration\r
+ * options.\r
*----------------------------------------------------------*/\r
\r
/*\r
* Interrupts that are assigned a priority at or below\r
* configMAX_API_CALL_INTERRUPT_PRIORITY (which counter-intuitively in the ARM\r
* generic interrupt controller [GIC] means a priority that has a numerical\r
- * value above configMAX_API_CALL_INTERRUPT_PRIORITY) can call FreeRTOS safe API\r
- * functions and will nest.\r
+ * value above configMAX_API_CALL_INTERRUPT_PRIORITY) can call interrupt safe\r
+ * FreeRTOS API functions and will nest.\r
*\r
* Interrupts that are assigned a priority above\r
* configMAX_API_CALL_INTERRUPT_PRIORITY (which in the GIC means a numerical\r
#define configMAX_API_CALL_INTERRUPT_PRIORITY 18\r
\r
/* The application will define the array used as the RTOS heap to ensure it can\r
-be located in the (faster) on-chip RAM. Whe this parameter is set to 1 the\r
+be located in the (faster) on-chip RAM. When this parameter is set to 1 the\r
application must define an array using the name and size as follows below, but\r
is free to locate the array in any suitable RAM region (the faster the better as\r
the stacks used by the tasks are allocated from this array):\r
*/\r
#define configAPPLICATION_ALLOCATED_HEAP 1\r
\r
-#define configCPU_CLOCK_HZ /* Not used in this portabsciex.com. */\r
+#define configCPU_CLOCK_HZ /* Not used in this demo. */\r
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1\r
#define configUSE_TICKLESS_IDLE 0\r
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )\r
#define configUSE_PREEMPTION 1\r
-#define configUSE_IDLE_HOOK 1\r
-#define configUSE_TICK_HOOK 1\r
#define configMAX_PRIORITIES ( 7 )\r
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 200 )\r
#define configTOTAL_HEAP_SIZE ( 50 * 1024 )\r
#define configQUEUE_REGISTRY_SIZE 8\r
#define configCHECK_FOR_STACK_OVERFLOW 2\r
#define configUSE_RECURSIVE_MUTEXES 1\r
-#define configUSE_MALLOC_FAILED_HOOK 1\r
#define configUSE_APPLICATION_TASK_TAG 0\r
#define configUSE_COUNTING_SEMAPHORES 1\r
#define configUSE_QUEUE_SETS 1\r
\r
+/* Hook/Callback related definitions. */\r
+#define configUSE_MALLOC_FAILED_HOOK 1\r
+#define configUSE_IDLE_HOOK 1\r
+#define configUSE_TICK_HOOK 1\r
+#define configUSE_DAEMON_TASK_STARTUP_HOOK 1\r
+\r
/* Co-routine definitions. */\r
#define configUSE_CO_ROUTINES 0\r
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )\r
#define configCHECK_FOR_STACK_OVERFLOW 0\r
#endif\r
\r
+#ifndef configRECORD_STACK_HIGH_ADDRESS\r
+ #define configRECORD_STACK_HIGH_ADDRESS 0\r
+#endif\r
+\r
+#ifndef configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H\r
+ #define configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H 0\r
+#endif\r
+\r
/* The following event macros are embedded in the kernel API calls. */\r
\r
#ifndef traceMOVED_TASK_TO_READY_STATE\r
UBaseType_t uxDummy5;\r
void *pxDummy6;\r
uint8_t ucDummy7[ configMAX_TASK_NAME_LEN ];\r
- #if ( portSTACK_GROWTH > 0 )\r
+ #if ( ( portSTACK_GROWTH > 0 ) || ( configRECORD_STACK_HIGH_ADDRESS == 1 ) )\r
void *pxDummy8;\r
#endif\r
#if ( portCRITICAL_NESTING_IN_TCB == 1 )\r
#error "include FreeRTOS.h must appear in source files before include timers.h"\r
#endif\r
\r
-/*lint -e537 This headers are only multiply included if the application code\r
+/*lint -save -e537 This headers are only multiply included if the application code\r
happens to also be including task.h. */\r
#include "task.h"\r
-/*lint +e537 */\r
+/*lint -restore */\r
\r
#ifdef __cplusplus\r
extern "C" {\r
#define tskSTATICALLY_ALLOCATED_STACK_ONLY ( ( uint8_t ) 1 )\r
#define tskSTATICALLY_ALLOCATED_STACK_AND_TCB ( ( uint8_t ) 2 )\r
\r
+/* If any of the following are set then task stacks are filled with a known\r
+value so the high water mark can be determined. If none of the following are\r
+set then don't fill the stack so there is no unnecessary dependency on memset. */\r
+#if( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) || ( configUSE_TRACE_FACILITY == 1 ) || ( INCLUDE_uxTaskGetStackHighWaterMark == 1 ) )\r
+ #define tskSET_NEW_STACKS_TO_KNOWN_VALUE 1\r
+#else\r
+ #define tskSET_NEW_STACKS_TO_KNOWN_VALUE 0\r
+#endif\r
+\r
/*\r
* Macros used by vListTask to indicate which state a task is in.\r
*/\r
StackType_t *pxStack; /*< Points to the start of the stack. */\r
char pcTaskName[ configMAX_TASK_NAME_LEN ];/*< Descriptive name given to the task when created. Facilitates debugging only. */ /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
\r
- #if ( portSTACK_GROWTH > 0 )\r
- StackType_t *pxEndOfStack; /*< Points to the end of the stack on architectures where the stack grows up from low memory. */\r
+ #if ( ( portSTACK_GROWTH > 0 ) || ( configRECORD_STACK_HIGH_ADDRESS == 1 ) )\r
+ StackType_t *pxEndOfStack; /*< Points to the highest valid address for the stack. */\r
#endif\r
\r
#if ( portCRITICAL_NESTING_IN_TCB == 1 )\r
#endif\r
\r
#if( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 )\r
- void *pvThreadLocalStoragePointers[ configNUM_THREAD_LOCAL_STORAGE_POINTERS ];\r
+ void *pvThreadLocalStoragePointers[ configNUM_THREAD_LOCAL_STORAGE_POINTERS ];\r
#endif\r
\r
#if( configGENERATE_RUN_TIME_STATS == 1 )\r
below to enable the use of older kernel aware debuggers. */\r
typedef tskTCB TCB_t;\r
\r
-/*lint -e956 A manual analysis and inspection has been used to determine which\r
-static variables must be declared volatile. */\r
+/*lint -save -e956 A manual analysis and inspection has been used to determine\r
+which static variables must be declared volatile. */\r
\r
PRIVILEGED_DATA TCB_t * volatile pxCurrentTCB = NULL;\r
\r
\r
#endif\r
\r
-/*lint +e956 */\r
+/*lint -restore */\r
\r
/*-----------------------------------------------------------*/\r
\r
#endif /* portUSING_MPU_WRAPPERS == 1 */\r
\r
/* Avoid dependency on memset() if it is not required. */\r
- #if( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) || ( configUSE_TRACE_FACILITY == 1 ) || ( INCLUDE_uxTaskGetStackHighWaterMark == 1 ) )\r
+ #if( tskSET_NEW_STACKS_TO_KNOWN_VALUE == 1 )\r
{\r
/* Fill the stack with a known value to assist debugging. */\r
( void ) memset( pxNewTCB->pxStack, ( int ) tskSTACK_FILL_BYTE, ( size_t ) ulStackDepth * sizeof( StackType_t ) );\r
}\r
- #endif /* ( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) || ( ( configUSE_TRACE_FACILITY == 1 ) || ( INCLUDE_uxTaskGetStackHighWaterMark == 1 ) ) ) */\r
+ #endif /* tskSET_NEW_STACKS_TO_KNOWN_VALUE */\r
\r
/* Calculate the top of stack address. This depends on whether the stack\r
grows from high memory to low (as per the 80x86) or vice versa.\r
\r
/* Check the alignment of the calculated top of stack is correct. */\r
configASSERT( ( ( ( portPOINTER_SIZE_TYPE ) pxTopOfStack & ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK ) == 0UL ) );\r
+\r
+ #if( configRECORD_STACK_HIGH_ADDRESS == 1 )\r
+ {\r
+ /* Also record the stack's high address, which may assist\r
+ debugging. */\r
+ pxNewTCB->pxEndOfStack = pxTopOfStack;\r
+ }\r
+ #endif /* configRECORD_STACK_HIGH_ADDRESS */\r
}\r
#else /* portSTACK_GROWTH */\r
{\r
/* Initialize the TCB stack to look as if the task was already running,\r
but had been interrupted by the scheduler. The return address is set\r
to the start of the task function. Once the stack has been initialised\r
- the top of stack variable is updated. */\r
+ the top of stack variable is updated. */\r
#if( portUSING_MPU_WRAPPERS == 1 )\r
{\r
pxNewTCB->pxTopOfStack = pxPortInitialiseStack( pxTopOfStack, pxTaskCode, pvParameters, xRunPrivileged );\r
#endif /* INCLUDE_vTaskSuspend */\r
}\r
\r
+/* Code below here allows additional code to be inserted into this source file,\r
+especially where access to file scope functions and data is needed (for example\r
+when performing module tests). */\r
\r
#ifdef FREERTOS_MODULE_TEST\r
#include "tasks_test_access_functions.h"\r
#endif\r
\r
+\r
+#if( configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H == 1 )\r
+\r
+ #include "freertos_tasks_c_additions.h"\r
+\r
+ static void freertos_tasks_c_additions_init( void )\r
+ {\r
+ #ifdef FREERTOS_TASKS_C_ADDITIONS_INIT\r
+ FREERTOS_TASKS_C_ADDITIONS_INIT();\r
+ #endif\r
+ }\r
+\r
+#endif\r
+\r
+\r
} u;\r
} DaemonTaskMessage_t;\r
\r
-/*lint -e956 A manual analysis and inspection has been used to determine which\r
-static variables must be declared volatile. */\r
+/*lint -save -e956 A manual analysis and inspection has been used to determine\r
+which static variables must be declared volatile. */\r
\r
/* The list in which active timers are stored. Timers are referenced in expire\r
time order, with the nearest expiry time at the front of the list. Only the\r
PRIVILEGED_DATA static QueueHandle_t xTimerQueue = NULL;\r
PRIVILEGED_DATA static TaskHandle_t xTimerTaskHandle = NULL;\r
\r
-/*lint +e956 */\r
+/*lint -restore */\r
\r
/*-----------------------------------------------------------*/\r
\r