/*\r
- FreeRTOS V6.0.0 - Copyright (C) 2009 Real Time Engineers Ltd.\r
+ FreeRTOS V6.0.5 - Copyright (C) 2010 Real Time Engineers Ltd.\r
\r
***************************************************************************\r
* *\r
*/\r
#define tskIDLE_STACK_SIZE configMINIMAL_STACK_SIZE\r
\r
-#define tskIDLE_PRIORITY ( ( unsigned portBASE_TYPE ) 0 )\r
-\r
/*\r
* Task control block. A task control block (TCB) is allocated to each task,\r
* and stores the context of the task.\r
{\r
signed portBASE_TYPE xReturn;\r
tskTCB * pxNewTCB;\r
-portBASE_TYPE xRunPrivileged;\r
\r
/* Allocate the memory required by the TCB and stack for the new task,\r
checking that the allocation was successful. */\r
{\r
portSTACK_TYPE *pxTopOfStack;\r
\r
- /* Should the task be created in privileged mode? */\r
- if( ( uxPriority & portPRIVILEGE_BIT ) != 0x00 )\r
- {\r
- xRunPrivileged = pdTRUE;\r
- }\r
- else\r
- {\r
- xRunPrivileged = pdFALSE;\r
- }\r
- uxPriority &= ~portPRIVILEGE_BIT;\r
+ #if( portUSING_MPU_WRAPPERS == 1 )\r
+ /* Should the task be created in privileged mode? */\r
+ portBASE_TYPE xRunPrivileged;\r
+ if( ( uxPriority & portPRIVILEGE_BIT ) != 0x00 )\r
+ {\r
+ xRunPrivileged = pdTRUE;\r
+ }\r
+ else\r
+ {\r
+ xRunPrivileged = pdFALSE;\r
+ }\r
+ uxPriority &= ~portPRIVILEGE_BIT;\r
+ #endif /* portUSING_MPU_WRAPPERS == 1 */\r
\r
/* Calculate the top of stack address. This depends on whether the\r
stack grows from high memory to low (as per the 80x86) or visa versa.\r
#else\r
{\r
pxNewTCB->pxTopOfStack = pxPortInitialiseStack( pxTopOfStack, pxTaskCode, pvParameters );\r
- ( void ) xRunPrivileged;\r
}\r
#endif\r
\r
passed since vTaskSetTimeout() was called. */\r
xReturn = pdTRUE;\r
}\r
- else if( ( ( portTickType ) xTickCount - ( portTickType ) pxTimeOut->xTimeOnEntering ) < ( portTickType ) *pxTicksToWait )\r
+ else if( ( ( portTickType ) ( ( portTickType ) xTickCount - ( portTickType ) pxTimeOut->xTimeOnEntering ) ) < ( portTickType ) *pxTicksToWait )\r
{\r
/* Not a genuine timeout. Adjust parameters for time remaining. */\r
*pxTicksToWait -= ( ( portTickType ) xTickCount - ( portTickType ) pxTimeOut->xTimeOnEntering );\r
do\r
{\r
listGET_OWNER_OF_NEXT_ENTRY( pxNextTCB, pxList );\r
- usStackRemaining = usTaskCheckFreeStackSpace( ( unsigned char * ) pxNextTCB->pxStack );\r
+ #if ( portSTACK_GROWTH > 0 )\r
+ {\r
+ usStackRemaining = usTaskCheckFreeStackSpace( ( unsigned char * ) pxNextTCB->pxEndOfStack );\r
+ }\r
+ #else\r
+ {\r
+ usStackRemaining = usTaskCheckFreeStackSpace( ( unsigned char * ) pxNextTCB->pxStack );\r
+ }\r
+ #endif \r
+ \r
sprintf( pcStatusString, ( char * ) "%s\t\t%c\t%u\t%u\t%u\r\n", pxNextTCB->pcTaskName, cStatus, ( unsigned int ) pxNextTCB->uxPriority, usStackRemaining, ( unsigned int ) pxNextTCB->uxTCBNumber );\r
strcat( ( char * ) pcWriteBuffer, ( char * ) pcStatusString );\r
\r