]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/include/task.h
Update version number to 8.1.2 after moving the defaulting of configUSE_PORT_OPTIMISE...
[freertos] / FreeRTOS / Source / include / task.h
index 97c08e8b8ba5deead2b0f2d2f4cee9fce34512e9..78418da8729848a5cdd5ac1f237e07ad70b619d0 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-    FreeRTOS V7.5.3 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+    FreeRTOS V8.1.2 - Copyright (C) 2014 Real Time Engineers Ltd.\r
     All rights reserved\r
 \r
     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
     the terms of the GNU General Public License (version 2) as published by the\r
     Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.\r
 \r
-    >>! NOTE: The modification to the GPL is included to allow you to distribute\r
-    >>! a combined work that includes FreeRTOS without being obliged to provide\r
-    >>! the source code for proprietary components outside of the FreeRTOS\r
-    >>! kernel.\r
+    >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
+    >>!   distribute a combined work that includes FreeRTOS without being   !<<\r
+    >>!   obliged to provide the source code for proprietary components     !<<\r
+    >>!   outside of the FreeRTOS kernel.                                   !<<\r
 \r
     FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
@@ -81,19 +81,28 @@ extern "C" {
  * MACROS AND DEFINITIONS\r
  *----------------------------------------------------------*/\r
 \r
-#define tskKERNEL_VERSION_NUMBER "V7.5.3"\r
+#define tskKERNEL_VERSION_NUMBER "V8.1.2"\r
+#define tskKERNEL_VERSION_MAJOR 8\r
+#define tskKERNEL_VERSION_MINOR 1\r
+#define tskKERNEL_VERSION_BUILD 2\r
 \r
 /**\r
  * task. h\r
  *\r
  * Type by which tasks are referenced.  For example, a call to xTaskCreate\r
- * returns (via a pointer parameter) an xTaskHandle variable that can then\r
+ * returns (via a pointer parameter) an TaskHandle_t variable that can then\r
  * be used as a parameter to vTaskDelete to delete the task.\r
  *\r
- * \defgroup xTaskHandle xTaskHandle\r
+ * \defgroup TaskHandle_t TaskHandle_t\r
  * \ingroup Tasks\r
  */\r
-typedef void * xTaskHandle;\r
+typedef void * TaskHandle_t;\r
+\r
+/*\r
+ * Defines the prototype to which the application task hook function must\r
+ * conform.\r
+ */\r
+typedef BaseType_t (*TaskHookFunction_t)( void * );\r
 \r
 /* Task states returned by eTaskGetState. */\r
 typedef enum\r
@@ -110,9 +119,9 @@ typedef enum
  */\r
 typedef struct xTIME_OUT\r
 {\r
-       portBASE_TYPE xOverflowCount;\r
-       portTickType  xTimeOnEntering;\r
-} xTimeOutType;\r
+       BaseType_t xOverflowCount;\r
+       TickType_t  xTimeOnEntering;\r
+} TimeOut_t;\r
 \r
 /*\r
  * Defines the memory ranges allocated to the task when an MPU is used.\r
@@ -120,37 +129,37 @@ typedef struct xTIME_OUT
 typedef struct xMEMORY_REGION\r
 {\r
        void *pvBaseAddress;\r
-       unsigned long ulLengthInBytes;\r
-       unsigned long ulParameters;\r
-} xMemoryRegion;\r
+       uint32_t ulLengthInBytes;\r
+       uint32_t ulParameters;\r
+} MemoryRegion_t;\r
 \r
 /*\r
  * Parameters required to create an MPU protected task.\r
  */\r
-typedef struct xTASK_PARAMTERS\r
+typedef struct xTASK_PARAMETERS\r
 {\r
-       pdTASK_CODE pvTaskCode;\r
-       const signed char * const pcName;\r
-       unsigned short usStackDepth;\r
+       TaskFunction_t pvTaskCode;\r
+       const char * const pcName;      /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
+       uint16_t usStackDepth;\r
        void *pvParameters;\r
-       unsigned portBASE_TYPE uxPriority;\r
-       portSTACK_TYPE *puxStackBuffer;\r
-       xMemoryRegion xRegions[ portNUM_CONFIGURABLE_REGIONS ];\r
-} xTaskParameters;\r
+       UBaseType_t uxPriority;\r
+       StackType_t *puxStackBuffer;\r
+       MemoryRegion_t xRegions[ portNUM_CONFIGURABLE_REGIONS ];\r
+} TaskParameters_t;\r
 \r
 /* Used with the uxTaskGetSystemState() function to return the state of each task\r
 in the system. */\r
 typedef struct xTASK_STATUS\r
 {\r
-       xTaskHandle xHandle;                                            /* The handle of the task to which the rest of the information in the structure relates. */\r
-       const signed char *pcTaskName;                          /* A pointer to the task's name.  This value will be invalid if the task was deleted since the structure was populated! */\r
-       unsigned portBASE_TYPE xTaskNumber;                     /* A number unique to the task. */\r
-       eTaskState eCurrentState;                                       /* The state in which the task existed when the structure was populated. */\r
-       unsigned portBASE_TYPE uxCurrentPriority;       /* The priority at which the task was running (may be inherited) when the structure was populated. */\r
-       unsigned portBASE_TYPE uxBasePriority;          /* The priority to which the task will return if the task's current priority has been inherited to avoid unbounded priority inversion when obtaining a mutex.  Only valid if configUSE_MUTEXES is defined as 1 in FreeRTOSConfig.h. */\r
-       unsigned long ulRunTimeCounter;                         /* The total run time allocated to the task so far, as defined by the run time stats clock.  See http://www.freertos.org/rtos-run-time-stats.html.  Only valid when configGENERATE_RUN_TIME_STATS is defined as 1 in FreeRTOSConfig.h. */\r
-       unsigned short usStackHighWaterMark;            /* The minimum amount of stack space that has remained for the task since the task was created.  The closer this value is to zero the closer the task has come to overflowing its stack. */\r
-} xTaskStatusType;\r
+       TaskHandle_t xHandle;                   /* The handle of the task to which the rest of the information in the structure relates. */\r
+       const char *pcTaskName;                 /* A pointer to the task's name.  This value will be invalid if the task was deleted since the structure was populated! */ /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
+       UBaseType_t xTaskNumber;                /* A number unique to the task. */\r
+       eTaskState eCurrentState;               /* The state in which the task existed when the structure was populated. */\r
+       UBaseType_t uxCurrentPriority;  /* The priority at which the task was running (may be inherited) when the structure was populated. */\r
+       UBaseType_t uxBasePriority;             /* The priority to which the task will return if the task's current priority has been inherited to avoid unbounded priority inversion when obtaining a mutex.  Only valid if configUSE_MUTEXES is defined as 1 in FreeRTOSConfig.h. */\r
+       uint32_t ulRunTimeCounter;              /* The total run time allocated to the task so far, as defined by the run time stats clock.  See http://www.freertos.org/rtos-run-time-stats.html.  Only valid when configGENERATE_RUN_TIME_STATS is defined as 1 in FreeRTOSConfig.h. */\r
+       uint16_t usStackHighWaterMark;  /* The minimum amount of stack space that has remained for the task since the task was created.  The closer this value is to zero the closer the task has come to overflowing its stack. */\r
+} TaskStatus_t;\r
 \r
 /* Possible return values for eTaskConfirmSleepModeStatus(). */\r
 typedef enum\r
@@ -161,12 +170,12 @@ typedef enum
 } eSleepModeStatus;\r
 \r
 \r
-/*\r
+/**\r
  * Defines the priority used by the idle task.  This must not be modified.\r
  *\r
  * \ingroup TaskUtils\r
  */\r
-#define tskIDLE_PRIORITY                       ( ( unsigned portBASE_TYPE ) 0U )\r
+#define tskIDLE_PRIORITY                       ( ( UBaseType_t ) 0U )\r
 \r
 /**\r
  * task. h\r
@@ -226,10 +235,13 @@ typedef enum
  */\r
 #define taskENABLE_INTERRUPTS()                portENABLE_INTERRUPTS()\r
 \r
-/* Definitions returned by xTaskGetSchedulerState(). */\r
-#define taskSCHEDULER_NOT_STARTED      ( ( portBASE_TYPE ) 0 )\r
-#define taskSCHEDULER_RUNNING          ( ( portBASE_TYPE ) 1 )\r
-#define taskSCHEDULER_SUSPENDED                ( ( portBASE_TYPE ) 2 )\r
+/* Definitions returned by xTaskGetSchedulerState().  taskSCHEDULER_SUSPENDED is\r
+0 to generate more optimal code when configASSERT() is defined as the constant\r
+is used in assert() statements. */\r
+#define taskSCHEDULER_SUSPENDED                ( ( BaseType_t ) 0 )\r
+#define taskSCHEDULER_NOT_STARTED      ( ( BaseType_t ) 1 )\r
+#define taskSCHEDULER_RUNNING          ( ( BaseType_t ) 2 )\r
+\r
 \r
 /*-----------------------------------------------------------\r
  * TASK CREATION API\r
@@ -238,13 +250,13 @@ typedef enum
 /**\r
  * task. h\r
  *<pre>\r
portBASE_TYPE xTaskCreate(\r
-                                                         pdTASK_CODE pvTaskCode,\r
BaseType_t xTaskCreate(\r
+                                                         TaskFunction_t pvTaskCode,\r
                                                          const char * const pcName,\r
-                                                         unsigned short usStackDepth,\r
+                                                         uint16_t usStackDepth,\r
                                                          void *pvParameters,\r
-                                                         unsigned portBASE_TYPE uxPriority,\r
-                                                         xTaskHandle *pvCreatedTask\r
+                                                         UBaseType_t uxPriority,\r
+                                                         TaskHandle_t *pvCreatedTask\r
                                                  );</pre>\r
  *\r
  * Create a new task and add it to the list of tasks that are ready to run.\r
@@ -258,7 +270,7 @@ typedef enum
  * must be implemented to never return (i.e. continuous loop).\r
  *\r
  * @param pcName A descriptive name for the task.  This is mainly used to\r
- * facilitate debugging.  Max length defined by tskMAX_TASK_NAME_LEN - default\r
+ * facilitate debugging.  Max length defined by configMAX_TASK_NAME_LEN - default\r
  * is 16.\r
  *\r
  * @param usStackDepth The size of the task stack specified as the number of\r
@@ -279,7 +291,7 @@ typedef enum
  * can be referenced.\r
  *\r
  * @return pdPASS if the task was successfully created and added to a ready\r
- * list, otherwise an error code defined in the file errors. h\r
+ * list, otherwise an error code defined in the file projdefs.h\r
  *\r
  * Example usage:\r
    <pre>\r
@@ -295,17 +307,21 @@ typedef enum
  // Function that creates a task.\r
  void vOtherFunction( void )\r
  {\r
- static unsigned char ucParameterToPass;\r
xTaskHandle xHandle;\r
+ static uint8_t ucParameterToPass;\r
TaskHandle_t xHandle = NULL;\r
 \r
         // Create the task, storing the handle.  Note that the passed parameter ucParameterToPass\r
         // must exist for the lifetime of the task, so in this case is declared static.  If it was just an\r
         // an automatic stack variable it might no longer exist, or at least have been corrupted, by the time\r
         // the new task attempts to access it.\r
         xTaskCreate( vTaskCode, "NAME", STACK_SIZE, &ucParameterToPass, tskIDLE_PRIORITY, &xHandle );\r
+     configASSERT( xHandle );\r
 \r
         // Use the handle to delete the task.\r
-        vTaskDelete( xHandle );\r
+     if( xHandle != NULL )\r
+     {\r
+            vTaskDelete( xHandle );\r
+     }\r
  }\r
    </pre>\r
  * \defgroup xTaskCreate xTaskCreate\r
@@ -316,7 +332,7 @@ typedef enum
 /**\r
  * task. h\r
  *<pre>\r
portBASE_TYPE xTaskCreateRestricted( xTaskParameters *pxTaskDefinition, xTaskHandle *pxCreatedTask );</pre>\r
BaseType_t xTaskCreateRestricted( TaskParameters_t *pxTaskDefinition, TaskHandle_t *pxCreatedTask );</pre>\r
  *\r
  * xTaskCreateRestricted() should only be used in systems that include an MPU\r
  * implementation.\r
@@ -334,12 +350,12 @@ typedef enum
  * can be referenced.\r
  *\r
  * @return pdPASS if the task was successfully created and added to a ready\r
- * list, otherwise an error code defined in the file errors. h\r
+ * list, otherwise an error code defined in the file projdefs.h\r
  *\r
  * Example usage:\r
    <pre>\r
-// Create an xTaskParameters structure that defines the task to be created.\r
-static const xTaskParameters xCheckTaskParameters =\r
+// Create an TaskParameters_t structure that defines the task to be created.\r
+static const TaskParameters_t xCheckTaskParameters =\r
 {\r
        vATask,         // pvTaskCode - the function that implements the task.\r
        "ATask",        // pcName - just a text name for the task to assist debugging.\r
@@ -362,7 +378,7 @@ static const xTaskParameters xCheckTaskParameters =
 \r
 int main( void )\r
 {\r
-xTaskHandle xHandle;\r
+TaskHandle_t xHandle;\r
 \r
        // Create a task from the const structure defined above.  The task handle\r
        // is requested (the second parameter is not NULL) but in this case just for\r
@@ -373,7 +389,7 @@ xTaskHandle xHandle;
        vTaskStartScheduler();\r
 \r
        // Will only get here if there was insufficient memory to create the idle\r
-       // task.\r
+       // and/or timer task.\r
        for( ;; );\r
 }\r
    </pre>\r
@@ -385,7 +401,7 @@ xTaskHandle xHandle;
 /**\r
  * task. h\r
  *<pre>\r
- void vTaskAllocateMPURegions( xTaskHandle xTask, const xMemoryRegion * const pxRegions );</pre>\r
+ void vTaskAllocateMPURegions( TaskHandle_t xTask, const MemoryRegion_t * const pxRegions );</pre>\r
  *\r
  * Memory regions are assigned to a restricted task when the task is created by\r
  * a call to xTaskCreateRestricted().  These regions can be redefined using\r
@@ -393,16 +409,16 @@ xTaskHandle xHandle;
  *\r
  * @param xTask The handle of the task being updated.\r
  *\r
- * @param xRegions A pointer to an xMemoryRegion structure that contains the\r
+ * @param xRegions A pointer to an MemoryRegion_t structure that contains the\r
  * new memory region definitions.\r
  *\r
  * Example usage:\r
    <pre>\r
-// Define an array of xMemoryRegion structures that configures an MPU region\r
+// Define an array of MemoryRegion_t structures that configures an MPU region\r
 // allowing read/write access for 1024 bytes starting at the beginning of the\r
 // ucOneKByte array.  The other two of the maximum 3 definable regions are\r
 // unused so set to zero.\r
-static const xMemoryRegion xAltRegions[ portNUM_CONFIGURABLE_REGIONS ] =\r
+static const MemoryRegion_t xAltRegions[ portNUM_CONFIGURABLE_REGIONS ] =\r
 {\r
        // Base address         Length          Parameters\r
        { ucOneKByte,           1024,           portMPU_REGION_READ_WRITE },\r
@@ -428,16 +444,16 @@ void vATask( void *pvParameters )
  * \defgroup xTaskCreateRestricted xTaskCreateRestricted\r
  * \ingroup Tasks\r
  */\r
-void vTaskAllocateMPURegions( xTaskHandle xTask, const xMemoryRegion * const pxRegions ) PRIVILEGED_FUNCTION;\r
+void vTaskAllocateMPURegions( TaskHandle_t xTask, const MemoryRegion_t * const pxRegions ) PRIVILEGED_FUNCTION;\r
 \r
 /**\r
  * task. h\r
- * <pre>void vTaskDelete( xTaskHandle xTask );</pre>\r
+ * <pre>void vTaskDelete( TaskHandle_t xTask );</pre>\r
  *\r
  * INCLUDE_vTaskDelete must be defined as 1 for this function to be available.\r
  * See the configuration section for more information.\r
  *\r
- * Remove a task from the RTOS real time kernels management.  The task being\r
+ * Remove a task from the RTOS real time kernel's management.  The task being\r
  * deleted will be removed from all ready, blocked, suspended and event lists.\r
  *\r
  * NOTE:  The idle task is responsible for freeing the kernel allocated\r
@@ -457,7 +473,7 @@ void vTaskAllocateMPURegions( xTaskHandle xTask, const xMemoryRegion * const pxR
    <pre>\r
  void vOtherFunction( void )\r
  {\r
xTaskHandle xHandle;\r
TaskHandle_t xHandle;\r
 \r
         // Create the task, storing the handle.\r
         xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, &xHandle );\r
@@ -469,7 +485,7 @@ void vTaskAllocateMPURegions( xTaskHandle xTask, const xMemoryRegion * const pxR
  * \defgroup vTaskDelete vTaskDelete\r
  * \ingroup Tasks\r
  */\r
-void vTaskDelete( xTaskHandle xTaskToDelete ) PRIVILEGED_FUNCTION;\r
+void vTaskDelete( TaskHandle_t xTaskToDelete ) PRIVILEGED_FUNCTION;\r
 \r
 /*-----------------------------------------------------------\r
  * TASK CONTROL API\r
@@ -477,11 +493,11 @@ void vTaskDelete( xTaskHandle xTaskToDelete ) PRIVILEGED_FUNCTION;
 \r
 /**\r
  * task. h\r
- * <pre>void vTaskDelay( portTickType xTicksToDelay );</pre>\r
+ * <pre>void vTaskDelay( const TickType_t xTicksToDelay );</pre>\r
  *\r
  * Delay a task for a given number of ticks.  The actual time that the\r
  * task remains blocked depends on the tick rate.  The constant\r
- * portTICK_RATE_MS can be used to calculate real time from the tick\r
+ * portTICK_PERIOD_MS can be used to calculate real time from the tick\r
  * rate - with the resolution of one tick period.\r
  *\r
  * INCLUDE_vTaskDelay must be defined as 1 for this function to be available.\r
@@ -492,7 +508,7 @@ void vTaskDelete( xTaskHandle xTaskToDelete ) PRIVILEGED_FUNCTION;
  * the time at which vTaskDelay() is called.  For example, specifying a block\r
  * period of 100 ticks will cause the task to unblock 100 ticks after\r
  * vTaskDelay() is called.  vTaskDelay() does not therefore provide a good method\r
- * of controlling the frequency of a cyclical task as the path taken through the\r
+ * of controlling the frequency of a periodic task as the path taken through the\r
  * code, as well as other task and interrupt activity, will effect the frequency\r
  * at which vTaskDelay() gets called and therefore the time at which the task\r
  * next executes.  See vTaskDelayUntil() for an alternative API function designed\r
@@ -505,12 +521,10 @@ void vTaskDelete( xTaskHandle xTaskToDelete ) PRIVILEGED_FUNCTION;
  *\r
  * Example usage:\r
 \r
- void vTaskFunction( void * pvParameters )\r
- {\r
  void vTaskFunction( void * pvParameters )\r
  {\r
  // Block for 500ms.\r
- const portTickType xDelay = 500 / portTICK_RATE_MS;\r
+ const TickType_t xDelay = 500 / portTICK_PERIOD_MS;\r
 \r
         for( ;; )\r
         {\r
@@ -523,16 +537,16 @@ void vTaskDelete( xTaskHandle xTaskToDelete ) PRIVILEGED_FUNCTION;
  * \defgroup vTaskDelay vTaskDelay\r
  * \ingroup TaskCtrl\r
  */\r
-void vTaskDelay( portTickType xTicksToDelay ) PRIVILEGED_FUNCTION;\r
+void vTaskDelay( const TickType_t xTicksToDelay ) PRIVILEGED_FUNCTION;\r
 \r
 /**\r
  * task. h\r
- * <pre>void vTaskDelayUntil( portTickType *pxPreviousWakeTime, portTickType xTimeIncrement );</pre>\r
+ * <pre>void vTaskDelayUntil( TickType_t *pxPreviousWakeTime, const TickType_t xTimeIncrement );</pre>\r
  *\r
  * INCLUDE_vTaskDelayUntil must be defined as 1 for this function to be available.\r
  * See the configuration section for more information.\r
  *\r
- * Delay a task until a specified time.  This function can be used by cyclical\r
+ * Delay a task until a specified time.  This function can be used by periodic\r
  * tasks to ensure a constant execution frequency.\r
  *\r
  * This function differs from vTaskDelay () in one important aspect:  vTaskDelay () will\r
@@ -547,7 +561,7 @@ void vTaskDelay( portTickType xTicksToDelay ) PRIVILEGED_FUNCTION;
  * is called, vTaskDelayUntil () specifies the absolute (exact) time at which it wishes to\r
  * unblock.\r
  *\r
- * The constant portTICK_RATE_MS can be used to calculate real time from the tick\r
+ * The constant portTICK_PERIOD_MS can be used to calculate real time from the tick\r
  * rate - with the resolution of one tick period.\r
  *\r
  * @param pxPreviousWakeTime Pointer to a variable that holds the time at which the\r
@@ -565,8 +579,8 @@ void vTaskDelay( portTickType xTicksToDelay ) PRIVILEGED_FUNCTION;
  // Perform an action every 10 ticks.\r
  void vTaskFunction( void * pvParameters )\r
  {\r
portTickType xLastWakeTime;\r
- const portTickType xFrequency = 10;\r
TickType_t xLastWakeTime;\r
+ const TickType_t xFrequency = 10;\r
 \r
         // Initialise the xLastWakeTime variable with the current time.\r
         xLastWakeTime = xTaskGetTickCount ();\r
@@ -582,13 +596,13 @@ void vTaskDelay( portTickType xTicksToDelay ) PRIVILEGED_FUNCTION;
  * \defgroup vTaskDelayUntil vTaskDelayUntil\r
  * \ingroup TaskCtrl\r
  */\r
-void vTaskDelayUntil( portTickType * const pxPreviousWakeTime, portTickType xTimeIncrement ) PRIVILEGED_FUNCTION;\r
+void vTaskDelayUntil( TickType_t * const pxPreviousWakeTime, const TickType_t xTimeIncrement ) PRIVILEGED_FUNCTION;\r
 \r
 /**\r
  * task. h\r
- * <pre>unsigned portBASE_TYPE uxTaskPriorityGet( xTaskHandle xTask );</pre>\r
+ * <pre>UBaseType_t uxTaskPriorityGet( TaskHandle_t xTask );</pre>\r
  *\r
- * INCLUDE_xTaskPriorityGet must be defined as 1 for this function to be available.\r
+ * INCLUDE_uxTaskPriorityGet must be defined as 1 for this function to be available.\r
  * See the configuration section for more information.\r
  *\r
  * Obtain the priority of any task.\r
@@ -602,7 +616,7 @@ void vTaskDelayUntil( portTickType * const pxPreviousWakeTime, portTickType xTim
    <pre>\r
  void vAFunction( void )\r
  {\r
xTaskHandle xHandle;\r
TaskHandle_t xHandle;\r
 \r
         // Create a task, storing the handle.\r
         xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, &xHandle );\r
@@ -629,11 +643,11 @@ void vTaskDelayUntil( portTickType * const pxPreviousWakeTime, portTickType xTim
  * \defgroup uxTaskPriorityGet uxTaskPriorityGet\r
  * \ingroup TaskCtrl\r
  */\r
-unsigned portBASE_TYPE uxTaskPriorityGet( xTaskHandle xTask ) PRIVILEGED_FUNCTION;\r
+UBaseType_t uxTaskPriorityGet( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;\r
 \r
 /**\r
  * task. h\r
- * <pre>eTaskState eTaskGetState( xTaskHandle xTask );</pre>\r
+ * <pre>eTaskState eTaskGetState( TaskHandle_t xTask );</pre>\r
  *\r
  * INCLUDE_eTaskGetState must be defined as 1 for this function to be available.\r
  * See the configuration section for more information.\r
@@ -647,11 +661,11 @@ unsigned portBASE_TYPE uxTaskPriorityGet( xTaskHandle xTask ) PRIVILEGED_FUNCTIO
  * state of the task might change between the function being called, and the\r
  * functions return value being tested by the calling task.\r
  */\r
-eTaskState eTaskGetState( xTaskHandle xTask ) PRIVILEGED_FUNCTION;\r
+eTaskState eTaskGetState( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;\r
 \r
 /**\r
  * task. h\r
- * <pre>void vTaskPrioritySet( xTaskHandle xTask, unsigned portBASE_TYPE uxNewPriority );</pre>\r
+ * <pre>void vTaskPrioritySet( TaskHandle_t xTask, UBaseType_t uxNewPriority );</pre>\r
  *\r
  * INCLUDE_vTaskPrioritySet must be defined as 1 for this function to be available.\r
  * See the configuration section for more information.\r
@@ -670,7 +684,7 @@ eTaskState eTaskGetState( xTaskHandle xTask ) PRIVILEGED_FUNCTION;
    <pre>\r
  void vAFunction( void )\r
  {\r
xTaskHandle xHandle;\r
TaskHandle_t xHandle;\r
 \r
         // Create a task, storing the handle.\r
         xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, &xHandle );\r
@@ -689,11 +703,11 @@ eTaskState eTaskGetState( xTaskHandle xTask ) PRIVILEGED_FUNCTION;
  * \defgroup vTaskPrioritySet vTaskPrioritySet\r
  * \ingroup TaskCtrl\r
  */\r
-void vTaskPrioritySet( xTaskHandle xTask, unsigned portBASE_TYPE uxNewPriority ) PRIVILEGED_FUNCTION;\r
+void vTaskPrioritySet( TaskHandle_t xTask, UBaseType_t uxNewPriority ) PRIVILEGED_FUNCTION;\r
 \r
 /**\r
  * task. h\r
- * <pre>void vTaskSuspend( xTaskHandle xTaskToSuspend );</pre>\r
+ * <pre>void vTaskSuspend( TaskHandle_t xTaskToSuspend );</pre>\r
  *\r
  * INCLUDE_vTaskSuspend must be defined as 1 for this function to be available.\r
  * See the configuration section for more information.\r
@@ -712,7 +726,7 @@ void vTaskPrioritySet( xTaskHandle xTask, unsigned portBASE_TYPE uxNewPriority )
    <pre>\r
  void vAFunction( void )\r
  {\r
xTaskHandle xHandle;\r
TaskHandle_t xHandle;\r
 \r
         // Create a task, storing the handle.\r
         xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, &xHandle );\r
@@ -740,18 +754,18 @@ void vTaskPrioritySet( xTaskHandle xTask, unsigned portBASE_TYPE uxNewPriority )
  * \defgroup vTaskSuspend vTaskSuspend\r
  * \ingroup TaskCtrl\r
  */\r
-void vTaskSuspend( xTaskHandle xTaskToSuspend ) PRIVILEGED_FUNCTION;\r
+void vTaskSuspend( TaskHandle_t xTaskToSuspend ) PRIVILEGED_FUNCTION;\r
 \r
 /**\r
  * task. h\r
- * <pre>void vTaskResume( xTaskHandle xTaskToResume );</pre>\r
+ * <pre>void vTaskResume( TaskHandle_t xTaskToResume );</pre>\r
  *\r
  * INCLUDE_vTaskSuspend must be defined as 1 for this function to be available.\r
  * See the configuration section for more information.\r
  *\r
  * Resumes a suspended task.\r
  *\r
- * A task that has been suspended by one of more calls to vTaskSuspend ()\r
+ * A task that has been suspended by one or more calls to vTaskSuspend ()\r
  * will be made available for running again by a single call to\r
  * vTaskResume ().\r
  *\r
@@ -761,7 +775,7 @@ void vTaskSuspend( xTaskHandle xTaskToSuspend ) PRIVILEGED_FUNCTION;
    <pre>\r
  void vAFunction( void )\r
  {\r
xTaskHandle xHandle;\r
TaskHandle_t xHandle;\r
 \r
         // Create a task, storing the handle.\r
         xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, &xHandle );\r
@@ -783,33 +797,42 @@ void vTaskSuspend( xTaskHandle xTaskToSuspend ) PRIVILEGED_FUNCTION;
         vTaskResume( xHandle );\r
 \r
         // The created task will once again get microcontroller processing\r
-        // time in accordance with it priority within the system.\r
+        // time in accordance with its priority within the system.\r
  }\r
    </pre>\r
  * \defgroup vTaskResume vTaskResume\r
  * \ingroup TaskCtrl\r
  */\r
-void vTaskResume( xTaskHandle xTaskToResume ) PRIVILEGED_FUNCTION;\r
+void vTaskResume( TaskHandle_t xTaskToResume ) PRIVILEGED_FUNCTION;\r
 \r
 /**\r
  * task. h\r
- * <pre>void xTaskResumeFromISR( xTaskHandle xTaskToResume );</pre>\r
+ * <pre>void xTaskResumeFromISR( TaskHandle_t xTaskToResume );</pre>\r
  *\r
  * INCLUDE_xTaskResumeFromISR must be defined as 1 for this function to be\r
  * available.  See the configuration section for more information.\r
  *\r
  * An implementation of vTaskResume() that can be called from within an ISR.\r
  *\r
- * A task that has been suspended by one of more calls to vTaskSuspend ()\r
+ * A task that has been suspended by one or more calls to vTaskSuspend ()\r
  * will be made available for running again by a single call to\r
  * xTaskResumeFromISR ().\r
  *\r
+ * xTaskResumeFromISR() should not be used to synchronise a task with an\r
+ * interrupt if there is a chance that the interrupt could arrive prior to the\r
+ * task being suspended - as this can lead to interrupts being missed. Use of a\r
+ * semaphore as a synchronisation mechanism would avoid this eventuality.\r
+ *\r
  * @param xTaskToResume Handle to the task being readied.\r
  *\r
+ * @return pdTRUE if resuming the task should result in a context switch,\r
+ * otherwise pdFALSE. This is used by the ISR to determine if a context switch\r
+ * may be required following the ISR.\r
+ *\r
  * \defgroup vTaskResumeFromISR vTaskResumeFromISR\r
  * \ingroup TaskCtrl\r
  */\r
-portBASE_TYPE xTaskResumeFromISR( xTaskHandle xTaskToResume ) PRIVILEGED_FUNCTION;\r
+BaseType_t xTaskResumeFromISR( TaskHandle_t xTaskToResume ) PRIVILEGED_FUNCTION;\r
 \r
 /*-----------------------------------------------------------\r
  * SCHEDULER CONTROL\r
@@ -820,12 +843,7 @@ portBASE_TYPE xTaskResumeFromISR( xTaskHandle xTaskToResume ) PRIVILEGED_FUNCTIO
  * <pre>void vTaskStartScheduler( void );</pre>\r
  *\r
  * Starts the real time kernel tick processing.  After calling the kernel\r
- * has control over which tasks are executed and when.  This function\r
- * does not return until an executing task calls vTaskEndScheduler ().\r
- *\r
- * At least one task should be created via a call to xTaskCreate ()\r
- * before calling vTaskStartScheduler ().  The idle task is created\r
- * automatically when the first application task is created.\r
+ * has control over which tasks are executed and when.\r
  *\r
  * See the demo application file main.c for an example of creating\r
  * tasks and starting the kernel.\r
@@ -853,6 +871,9 @@ void vTaskStartScheduler( void ) PRIVILEGED_FUNCTION;
  * task. h\r
  * <pre>void vTaskEndScheduler( void );</pre>\r
  *\r
+ * NOTE:  At the time of writing only the x86 real mode port, which runs on a PC\r
+ * in place of DOS, implements this function.\r
+ *\r
  * Stops the real time kernel tick.  All created tasks will be automatically\r
  * deleted and multitasking (either preemptive or cooperative) will\r
  * stop.  Execution then resumes from the point where vTaskStartScheduler ()\r
@@ -906,8 +927,8 @@ void vTaskEndScheduler( void ) PRIVILEGED_FUNCTION;
  * task. h\r
  * <pre>void vTaskSuspendAll( void );</pre>\r
  *\r
- * Suspends all real time kernel activity while keeping interrupts (including the\r
- * kernel tick) enabled.\r
+ * Suspends the scheduler without disabling interrupts.  Context switches will\r
+ * not occur while the scheduler is suspended.\r
  *\r
  * After calling vTaskSuspendAll () the calling task will continue to execute\r
  * without risk of being swapped out until a call to xTaskResumeAll () has been\r
@@ -955,11 +976,13 @@ void vTaskSuspendAll( void ) PRIVILEGED_FUNCTION;
 \r
 /**\r
  * task. h\r
- * <pre>char xTaskResumeAll( void );</pre>\r
+ * <pre>BaseType_t xTaskResumeAll( void );</pre>\r
  *\r
- * Resumes real time kernel activity following a call to vTaskSuspendAll ().\r
- * After a call to vTaskSuspendAll () the kernel will take control of which\r
- * task is executing at any time.\r
+ * Resumes scheduler activity after it was suspended by a call to\r
+ * vTaskSuspendAll().\r
+ *\r
+ * xTaskResumeAll() only resumes the scheduler.  It does not unsuspend tasks\r
+ * that were previously suspended by a call to vTaskSuspend().\r
  *\r
  * @return If resuming the scheduler caused a context switch then pdTRUE is\r
  *               returned, otherwise pdFALSE is returned.\r
@@ -1003,18 +1026,7 @@ void vTaskSuspendAll( void ) PRIVILEGED_FUNCTION;
  * \defgroup xTaskResumeAll xTaskResumeAll\r
  * \ingroup SchedulerControl\r
  */\r
-signed portBASE_TYPE xTaskResumeAll( void ) PRIVILEGED_FUNCTION;\r
-\r
-/**\r
- * task. h\r
- * <pre>signed portBASE_TYPE xTaskIsTaskSuspended( const xTaskHandle xTask );</pre>\r
- *\r
- * Utility task that simply returns pdTRUE if the task referenced by xTask is\r
- * currently in the Suspended state, or pdFALSE if the task referenced by xTask\r
- * is in any other state.\r
- *\r
- */\r
-signed portBASE_TYPE xTaskIsTaskSuspended( xTaskHandle xTask ) PRIVILEGED_FUNCTION;\r
+BaseType_t xTaskResumeAll( void ) PRIVILEGED_FUNCTION;\r
 \r
 /*-----------------------------------------------------------\r
  * TASK UTILITIES\r
@@ -1022,34 +1034,34 @@ signed portBASE_TYPE xTaskIsTaskSuspended( xTaskHandle xTask ) PRIVILEGED_FUNCTI
 \r
 /**\r
  * task. h\r
- * <PRE>portTickType xTaskGetTickCount( void );</PRE>\r
+ * <PRE>TickType_t xTaskGetTickCount( void );</PRE>\r
  *\r
  * @return The count of ticks since vTaskStartScheduler was called.\r
  *\r
  * \defgroup xTaskGetTickCount xTaskGetTickCount\r
  * \ingroup TaskUtils\r
  */\r
-portTickType xTaskGetTickCount( void ) PRIVILEGED_FUNCTION;\r
+TickType_t xTaskGetTickCount( void ) PRIVILEGED_FUNCTION;\r
 \r
 /**\r
  * task. h\r
- * <PRE>portTickType xTaskGetTickCountFromISR( void );</PRE>\r
+ * <PRE>TickType_t xTaskGetTickCountFromISR( void );</PRE>\r
  *\r
  * @return The count of ticks since vTaskStartScheduler was called.\r
  *\r
  * This is a version of xTaskGetTickCount() that is safe to be called from an\r
- * ISR - provided that portTickType is the natural word size of the\r
+ * ISR - provided that TickType_t is the natural word size of the\r
  * microcontroller being used or interrupt nesting is either not supported or\r
  * not being used.\r
  *\r
- * \defgroup xTaskGetTickCount xTaskGetTickCount\r
+ * \defgroup xTaskGetTickCountFromISR xTaskGetTickCountFromISR\r
  * \ingroup TaskUtils\r
  */\r
-portTickType xTaskGetTickCountFromISR( void ) PRIVILEGED_FUNCTION;\r
+TickType_t xTaskGetTickCountFromISR( void ) PRIVILEGED_FUNCTION;\r
 \r
 /**\r
  * task. h\r
- * <PRE>unsigned short uxTaskGetNumberOfTasks( void );</PRE>\r
+ * <PRE>uint16_t uxTaskGetNumberOfTasks( void );</PRE>\r
  *\r
  * @return The number of tasks that the real time kernel is currently managing.\r
  * This includes all ready, blocked and suspended tasks.  A task that\r
@@ -1059,25 +1071,25 @@ portTickType xTaskGetTickCountFromISR( void ) PRIVILEGED_FUNCTION;
  * \defgroup uxTaskGetNumberOfTasks uxTaskGetNumberOfTasks\r
  * \ingroup TaskUtils\r
  */\r
-unsigned portBASE_TYPE uxTaskGetNumberOfTasks( void ) PRIVILEGED_FUNCTION;\r
+UBaseType_t uxTaskGetNumberOfTasks( void ) PRIVILEGED_FUNCTION;\r
 \r
 /**\r
  * task. h\r
- * <PRE>signed char *pcTaskGetTaskName( xTaskHandle xTaskToQuery );</PRE>\r
+ * <PRE>char *pcTaskGetTaskName( TaskHandle_t xTaskToQuery );</PRE>\r
  *\r
  * @return The text (human readable) name of the task referenced by the handle\r
- * xTaskToQueury.  A task can query its own name by either passing in its own\r
+ * xTaskToQuery.  A task can query its own name by either passing in its own\r
  * handle, or by setting xTaskToQuery to NULL.  INCLUDE_pcTaskGetTaskName must be\r
  * set to 1 in FreeRTOSConfig.h for pcTaskGetTaskName() to be available.\r
  *\r
  * \defgroup pcTaskGetTaskName pcTaskGetTaskName\r
  * \ingroup TaskUtils\r
  */\r
-signed char *pcTaskGetTaskName( xTaskHandle xTaskToQuery );\r
+char *pcTaskGetTaskName( TaskHandle_t xTaskToQuery ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
 \r
 /**\r
  * task.h\r
- * <PRE>unsigned portBASE_TYPE uxTaskGetStackHighWaterMark( xTaskHandle xTask );</PRE>\r
+ * <PRE>UBaseType_t uxTaskGetStackHighWaterMark( TaskHandle_t xTask );</PRE>\r
  *\r
  * INCLUDE_uxTaskGetStackHighWaterMark must be set to 1 in FreeRTOSConfig.h for\r
  * this function to be available.\r
@@ -1090,13 +1102,14 @@ signed char *pcTaskGetTaskName( xTaskHandle xTaskToQuery );
  * @param xTask Handle of the task associated with the stack to be checked.\r
  * Set xTask to NULL to check the stack of the calling task.\r
  *\r
- * @return The smallest amount of free stack space there has been (in bytes)\r
- * since the task referenced by xTask was created.\r
+ * @return The smallest amount of free stack space there has been (in words, so\r
+ * actual spaces on the stack rather than bytes) since the task referenced by\r
+ * xTask was created.\r
  */\r
-unsigned portBASE_TYPE uxTaskGetStackHighWaterMark( xTaskHandle xTask ) PRIVILEGED_FUNCTION;\r
+UBaseType_t uxTaskGetStackHighWaterMark( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;\r
 \r
-/* When using trace macros it is sometimes necessary to include tasks.h before\r
-FreeRTOS.h.  When this is done pdTASK_HOOK_CODE will not yet have been defined,\r
+/* When using trace macros it is sometimes necessary to include task.h before\r
+FreeRTOS.h.  When this is done TaskHookFunction_t will not yet have been defined,\r
 so the following two prototypes will cause a compilation error.  This can be\r
 fixed by simply guarding against the inclusion of these two prototypes unless\r
 they are explicitly required by the configUSE_APPLICATION_TASK_TAG configuration\r
@@ -1105,35 +1118,36 @@ constant. */
        #if configUSE_APPLICATION_TASK_TAG == 1\r
                /**\r
                 * task.h\r
-                * <pre>void vTaskSetApplicationTaskTag( xTaskHandle xTask, pdTASK_HOOK_CODE pxHookFunction );</pre>\r
+                * <pre>void vTaskSetApplicationTaskTag( TaskHandle_t xTask, TaskHookFunction_t pxHookFunction );</pre>\r
                 *\r
                 * Sets pxHookFunction to be the task hook function used by the task xTask.\r
                 * Passing xTask as NULL has the effect of setting the calling tasks hook\r
                 * function.\r
                 */\r
-               void vTaskSetApplicationTaskTag( xTaskHandle xTask, pdTASK_HOOK_CODE pxHookFunction ) PRIVILEGED_FUNCTION;\r
+               void vTaskSetApplicationTaskTag( TaskHandle_t xTask, TaskHookFunction_t pxHookFunction ) PRIVILEGED_FUNCTION;\r
 \r
                /**\r
                 * task.h\r
-                * <pre>void xTaskGetApplicationTaskTag( xTaskHandle xTask );</pre>\r
+                * <pre>void xTaskGetApplicationTaskTag( TaskHandle_t xTask );</pre>\r
                 *\r
                 * Returns the pxHookFunction value assigned to the task xTask.\r
                 */\r
-               pdTASK_HOOK_CODE xTaskGetApplicationTaskTag( xTaskHandle xTask ) PRIVILEGED_FUNCTION;\r
+               TaskHookFunction_t xTaskGetApplicationTaskTag( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;\r
        #endif /* configUSE_APPLICATION_TASK_TAG ==1 */\r
 #endif /* ifdef configUSE_APPLICATION_TASK_TAG */\r
 \r
 /**\r
  * task.h\r
- * <pre>portBASE_TYPE xTaskCallApplicationTaskHook( xTaskHandle xTask, pdTASK_HOOK_CODE pxHookFunction );</pre>\r
+ * <pre>BaseType_t xTaskCallApplicationTaskHook( TaskHandle_t xTask, void *pvParameter );</pre>\r
  *\r
  * Calls the hook function associated with xTask.  Passing xTask as NULL has\r
  * the effect of calling the Running tasks (the calling task) hook function.\r
  *\r
  * pvParameter is passed to the hook function for the task to interpret as it\r
- * wants.\r
+ * wants.  The return value is the value returned by the task hook function\r
+ * registered by the user.\r
  */\r
-portBASE_TYPE xTaskCallApplicationTaskHook( xTaskHandle xTask, void *pvParameter ) PRIVILEGED_FUNCTION;\r
+BaseType_t xTaskCallApplicationTaskHook( TaskHandle_t xTask, void *pvParameter ) PRIVILEGED_FUNCTION;\r
 \r
 /**\r
  * xTaskGetIdleTaskHandle() is only available if\r
@@ -1142,29 +1156,29 @@ portBASE_TYPE xTaskCallApplicationTaskHook( xTaskHandle xTask, void *pvParameter
  * Simply returns the handle of the idle task.  It is not valid to call\r
  * xTaskGetIdleTaskHandle() before the scheduler has been started.\r
  */\r
-xTaskHandle xTaskGetIdleTaskHandle( void );\r
+TaskHandle_t xTaskGetIdleTaskHandle( void );\r
 \r
 /**\r
- * configUSE_TRACE_FACILITY must bet defined as 1 in FreeRTOSConfig.h for\r
+ * configUSE_TRACE_FACILITY must be defined as 1 in FreeRTOSConfig.h for\r
  * uxTaskGetSystemState() to be available.\r
  *\r
- * uxTaskGetSystemState() populates an xTaskStatusType structure for each task in\r
- * the system.  xTaskStatusType structures contain, among other things, members\r
+ * uxTaskGetSystemState() populates an TaskStatus_t structure for each task in\r
+ * the system.  TaskStatus_t structures contain, among other things, members\r
  * for the task handle, task name, task priority, task state, and total amount\r
- * of run time consumed by the task.  See the xTaskStatusType structure\r
+ * of run time consumed by the task.  See the TaskStatus_t structure\r
  * definition in this file for the full member list.\r
  *\r
  * NOTE:  This function is intended for debugging use only as its use results in\r
  * the scheduler remaining suspended for an extended period.\r
  *\r
- * @param pxTaskStatusArray A pointer to an array of xTaskStatusType structures.\r
- * The array must contain at least one xTaskStatusType structure for each task \r
- * that is under the control of the RTOS.  The number of tasks under the control \r
+ * @param pxTaskStatusArray A pointer to an array of TaskStatus_t structures.\r
+ * The array must contain at least one TaskStatus_t structure for each task\r
+ * that is under the control of the RTOS.  The number of tasks under the control\r
  * of the RTOS can be determined using the uxTaskGetNumberOfTasks() API function.\r
  *\r
  * @param uxArraySize The size of the array pointed to by the pxTaskStatusArray\r
  * parameter.  The size is specified as the number of indexes in the array, or\r
- * the number of xTaskStatusType structures contained in the array, not by the\r
+ * the number of TaskStatus_t structures contained in the array, not by the\r
  * number of bytes in the array.\r
  *\r
  * @param pulTotalRunTime If configGENERATE_RUN_TIME_STATS is set to 1 in\r
@@ -1173,7 +1187,7 @@ xTaskHandle xTaskGetIdleTaskHandle( void );
  * http://www.freertos.org/rtos-run-time-stats.html) since the target booted.\r
  * pulTotalRunTime can be set to NULL to omit the total run time information.\r
  *\r
- * @return The number of xTaskStatusType structures that were populated by\r
+ * @return The number of TaskStatus_t structures that were populated by\r
  * uxTaskGetSystemState().  This should equal the number returned by the\r
  * uxTaskGetNumberOfTasks() API function, but will be zero if the value passed\r
  * in the uxArraySize parameter was too small.\r
@@ -1183,22 +1197,22 @@ xTaskHandle xTaskGetIdleTaskHandle( void );
     // This example demonstrates how a human readable table of run time stats\r
        // information is generated from raw data provided by uxTaskGetSystemState().\r
        // The human readable table is written to pcWriteBuffer\r
-       void vTaskGetRunTimeStats( signed char *pcWriteBuffer )\r
+       void vTaskGetRunTimeStats( char *pcWriteBuffer )\r
        {\r
-       xTaskStatusType *pxTaskStatusArray;\r
-       volatile unsigned portBASE_TYPE uxArraySize, x;\r
-       unsigned long ulTotalRunTime, ulStatsAsPercentage;\r
+       TaskStatus_t *pxTaskStatusArray;\r
+       volatile UBaseType_t uxArraySize, x;\r
+       uint32_t ulTotalRunTime, ulStatsAsPercentage;\r
 \r
                // Make sure the write buffer does not contain a string.\r
                *pcWriteBuffer = 0x00;\r
 \r
                // Take a snapshot of the number of tasks in case it changes while this\r
                // function is executing.\r
-               uxArraySize = uxCurrentNumberOfTasks();\r
+               uxArraySize = uxTaskGetNumberOfTasks();\r
 \r
-               // Allocate a xTaskStatusType structure for each task.  An array could be\r
+               // Allocate a TaskStatus_t structure for each task.  An array could be\r
                // allocated statically at compile time.\r
-               pxTaskStatusArray = pvPortMalloc( uxCurrentNumberOfTasks * sizeof( xTaskStatusType ) );\r
+               pxTaskStatusArray = pvPortMalloc( uxArraySize * sizeof( TaskStatus_t ) );\r
 \r
                if( pxTaskStatusArray != NULL )\r
                {\r
@@ -1222,13 +1236,13 @@ xTaskHandle xTaskGetIdleTaskHandle( void );
 \r
                                        if( ulStatsAsPercentage > 0UL )\r
                                        {\r
-                                               sprintf( ( char * ) pcWriteBuffer, ( char * ) "%s\t\t%lu\t\t%lu%%\r\n", pxTaskStatusArray[ x ].pcTaskName, pxTaskStatusArray[ x ].ulRunTimeCounter, ulStatsAsPercentage );\r
+                                               sprintf( pcWriteBuffer, "%s\t\t%lu\t\t%lu%%\r\n", pxTaskStatusArray[ x ].pcTaskName, pxTaskStatusArray[ x ].ulRunTimeCounter, ulStatsAsPercentage );\r
                                        }\r
                                        else\r
                                        {\r
                                                // If the percentage is zero here then the task has\r
                                                // consumed less than 1% of the total run time.\r
-                                               sprintf( ( char * ) pcWriteBuffer, ( char * ) "%s\t\t%lu\t\t<1%%\r\n", pxTaskStatusArray[ x ].pcTaskName, pxTaskStatusArray[ x ].ulRunTimeCounter );\r
+                                               sprintf( pcWriteBuffer, "%s\t\t%lu\t\t<1%%\r\n", pxTaskStatusArray[ x ].pcTaskName, pxTaskStatusArray[ x ].ulRunTimeCounter );\r
                                        }\r
 \r
                                        pcWriteBuffer += strlen( ( char * ) pcWriteBuffer );\r
@@ -1241,7 +1255,7 @@ xTaskHandle xTaskGetIdleTaskHandle( void );
        }\r
        </pre>\r
  */\r
-unsigned portBASE_TYPE uxTaskGetSystemState( xTaskStatusType *pxTaskStatusArray, unsigned portBASE_TYPE uxArraySize, unsigned long *pulTotalRunTime );\r
+UBaseType_t uxTaskGetSystemState( TaskStatus_t * const pxTaskStatusArray, const UBaseType_t uxArraySize, uint32_t * const pulTotalRunTime );\r
 \r
 /**\r
  * task. h\r
@@ -1281,14 +1295,14 @@ unsigned portBASE_TYPE uxTaskGetSystemState( xTaskStatusType *pxTaskStatusArray,
  * call to vTaskList().\r
  *\r
  * @param pcWriteBuffer A buffer into which the above mentioned details\r
- * will be written, in ascii form.  This buffer is assumed to be large\r
+ * will be written, in ASCII form.  This buffer is assumed to be large\r
  * enough to contain the generated report.  Approximately 40 bytes per\r
  * task should be sufficient.\r
  *\r
  * \defgroup vTaskList vTaskList\r
  * \ingroup TaskUtils\r
  */\r
-void vTaskList( signed char *pcWriteBuffer ) PRIVILEGED_FUNCTION;\r
+void vTaskList( char * pcWriteBuffer ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
 \r
 /**\r
  * task. h\r
@@ -1297,7 +1311,7 @@ void vTaskList( signed char *pcWriteBuffer ) PRIVILEGED_FUNCTION;
  * configGENERATE_RUN_TIME_STATS and configUSE_STATS_FORMATTING_FUNCTIONS\r
  * must both be defined as 1 for this function to be available.  The application\r
  * must also then provide definitions for\r
- * portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() and portGET_RUN_TIME_COUNTER_VALUE\r
+ * portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() and portGET_RUN_TIME_COUNTER_VALUE()\r
  * to configure a peripheral timer/counter and return the timers current count\r
  * value respectively.  The counter should be at least 10 times the frequency of\r
  * the tick count.\r
@@ -1335,14 +1349,14 @@ void vTaskList( signed char *pcWriteBuffer ) PRIVILEGED_FUNCTION;
  * vTaskGetRunTimeStats().\r
  *\r
  * @param pcWriteBuffer A buffer into which the execution times will be\r
- * written, in ascii form.  This buffer is assumed to be large enough to\r
+ * written, in ASCII form.  This buffer is assumed to be large enough to\r
  * contain the generated report.  Approximately 40 bytes per task should\r
  * be sufficient.\r
  *\r
  * \defgroup vTaskGetRunTimeStats vTaskGetRunTimeStats\r
  * \ingroup TaskUtils\r
  */\r
-void vTaskGetRunTimeStats( signed char *pcWriteBuffer ) PRIVILEGED_FUNCTION;\r
+void vTaskGetRunTimeStats( char *pcWriteBuffer ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
 \r
 /*-----------------------------------------------------------\r
  * SCHEDULER INTERNALS AVAILABLE FOR PORTING PURPOSES\r
@@ -1363,7 +1377,7 @@ void vTaskGetRunTimeStats( signed char *pcWriteBuffer ) PRIVILEGED_FUNCTION;
  *   + Time slicing is in use and there is a task of equal priority to the\r
  *     currently running task.\r
  */\r
-portBASE_TYPE xTaskIncrementTick( void ) PRIVILEGED_FUNCTION;\r
+BaseType_t xTaskIncrementTick( void ) PRIVILEGED_FUNCTION;\r
 \r
 /*\r
  * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE.  IT IS AN\r
@@ -1378,15 +1392,26 @@ portBASE_TYPE xTaskIncrementTick( void ) PRIVILEGED_FUNCTION;
  * there be no higher priority tasks waiting on the same event) or\r
  * the delay period expires.\r
  *\r
+ * The 'unordered' version replaces the event list item value with the\r
+ * xItemValue value, and inserts the list item at the end of the list.\r
+ *\r
+ * The 'ordered' version uses the existing event list item value (which is the\r
+ * owning tasks priority) to insert the list item into the event list is task\r
+ * priority order.\r
+ *\r
  * @param pxEventList The list containing tasks that are blocked waiting\r
  * for the event to occur.\r
  *\r
+ * @param xItemValue The item value to use for the event list item when the\r
+ * event list is not ordered by task priority.\r
+ *\r
  * @param xTicksToWait The maximum amount of time that the task should wait\r
  * for the event to occur.  This is specified in kernel ticks,the constant\r
- * portTICK_RATE_MS can be used to convert kernel ticks into a real time\r
+ * portTICK_PERIOD_MS can be used to convert kernel ticks into a real time\r
  * period.\r
  */\r
-void vTaskPlaceOnEventList( xList * const pxEventList, portTickType xTicksToWait ) PRIVILEGED_FUNCTION;\r
+void vTaskPlaceOnEventList( List_t * const pxEventList, const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;\r
+void vTaskPlaceOnUnorderedEventList( List_t * pxEventList, const TickType_t xItemValue, const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;\r
 \r
 /*\r
  * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE.  IT IS AN\r
@@ -1398,10 +1423,8 @@ void vTaskPlaceOnEventList( xList * const pxEventList, portTickType xTicksToWait
  * The difference being that this function does not permit tasks to block\r
  * indefinitely, whereas vTaskPlaceOnEventList() does.\r
  *\r
- * @return pdTRUE if the task being removed has a higher priority than the task\r
- * making the call, otherwise pdFALSE.\r
  */\r
-void vTaskPlaceOnEventListRestricted( xList * const pxEventList, portTickType xTicksToWait ) PRIVILEGED_FUNCTION;\r
+void vTaskPlaceOnEventListRestricted( List_t * const pxEventList, const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;\r
 \r
 /*\r
  * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE.  IT IS AN\r
@@ -1412,13 +1435,23 @@ void vTaskPlaceOnEventListRestricted( xList * const pxEventList, portTickType xT
  * Removes a task from both the specified event list and the list of blocked\r
  * tasks, and places it on a ready queue.\r
  *\r
- * xTaskRemoveFromEventList () will be called if either an event occurs to\r
- * unblock a task, or the block timeout period expires.\r
+ * xTaskRemoveFromEventList()/xTaskRemoveFromUnorderedEventList() will be called\r
+ * if either an event occurs to unblock a task, or the block timeout period\r
+ * expires.\r
+ *\r
+ * xTaskRemoveFromEventList() is used when the event list is in task priority\r
+ * order.  It removes the list item from the head of the event list as that will\r
+ * have the highest priority owning task of all the tasks on the event list.\r
+ * xTaskRemoveFromUnorderedEventList() is used when the event list is not\r
+ * ordered and the event list items hold something other than the owning tasks\r
+ * priority.  In this case the event list item value is updated to the value\r
+ * passed in the xItemValue parameter.\r
  *\r
  * @return pdTRUE if the task being removed has a higher priority than the task\r
  * making the call, otherwise pdFALSE.\r
  */\r
-signed portBASE_TYPE xTaskRemoveFromEventList( const xList * const pxEventList ) PRIVILEGED_FUNCTION;\r
+BaseType_t xTaskRemoveFromEventList( const List_t * const pxEventList ) PRIVILEGED_FUNCTION;\r
+BaseType_t xTaskRemoveFromUnorderedEventList( ListItem_t * pxEventListItem, const TickType_t xItemValue ) PRIVILEGED_FUNCTION;\r
 \r
 /*\r
  * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE.  IT IS ONLY\r
@@ -1430,21 +1463,27 @@ signed portBASE_TYPE xTaskRemoveFromEventList( const xList * const pxEventList )
  */\r
 void vTaskSwitchContext( void ) PRIVILEGED_FUNCTION;\r
 \r
+/*\r
+ * THESE FUNCTIONS MUST NOT BE USED FROM APPLICATION CODE.  THEY ARE USED BY\r
+ * THE EVENT BITS MODULE.\r
+ */\r
+TickType_t uxTaskResetEventItemValue( void ) PRIVILEGED_FUNCTION;\r
+\r
 /*\r
  * Return the handle of the calling task.\r
  */\r
-xTaskHandle xTaskGetCurrentTaskHandle( void ) PRIVILEGED_FUNCTION;\r
+TaskHandle_t xTaskGetCurrentTaskHandle( void ) PRIVILEGED_FUNCTION;\r
 \r
 /*\r
  * Capture the current time status for future reference.\r
  */\r
-void vTaskSetTimeOutState( xTimeOutType * const pxTimeOut ) PRIVILEGED_FUNCTION;\r
+void vTaskSetTimeOutState( TimeOut_t * const pxTimeOut ) PRIVILEGED_FUNCTION;\r
 \r
 /*\r
  * Compare the time status now with that previously captured to see if the\r
  * timeout has expired.\r
  */\r
-portBASE_TYPE xTaskCheckForTimeOut( xTimeOutType * const pxTimeOut, portTickType * const pxTicksToWait ) PRIVILEGED_FUNCTION;\r
+BaseType_t xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut, TickType_t * const pxTicksToWait ) PRIVILEGED_FUNCTION;\r
 \r
 /*\r
  * Shortcut used by the queue implementation to prevent unnecessary call to\r
@@ -1456,47 +1495,49 @@ void vTaskMissedYield( void ) PRIVILEGED_FUNCTION;
  * Returns the scheduler state as taskSCHEDULER_RUNNING,\r
  * taskSCHEDULER_NOT_STARTED or taskSCHEDULER_SUSPENDED.\r
  */\r
-portBASE_TYPE xTaskGetSchedulerState( void ) PRIVILEGED_FUNCTION;\r
+BaseType_t xTaskGetSchedulerState( void ) PRIVILEGED_FUNCTION;\r
 \r
 /*\r
  * Raises the priority of the mutex holder to that of the calling task should\r
  * the mutex holder have a priority less than the calling task.\r
  */\r
-void vTaskPriorityInherit( xTaskHandle const pxMutexHolder ) PRIVILEGED_FUNCTION;\r
+void vTaskPriorityInherit( TaskHandle_t const pxMutexHolder ) PRIVILEGED_FUNCTION;\r
 \r
 /*\r
  * Set the priority of a task back to its proper priority in the case that it\r
  * inherited a higher priority while it was holding a semaphore.\r
  */\r
-void vTaskPriorityDisinherit( xTaskHandle const pxMutexHolder ) PRIVILEGED_FUNCTION;\r
+BaseType_t xTaskPriorityDisinherit( TaskHandle_t const pxMutexHolder ) PRIVILEGED_FUNCTION;\r
 \r
 /*\r
  * Generic version of the task creation function which is in turn called by the\r
  * xTaskCreate() and xTaskCreateRestricted() macros.\r
  */\r
-signed portBASE_TYPE xTaskGenericCreate( pdTASK_CODE pxTaskCode, const signed char * const pcName, unsigned short usStackDepth, void *pvParameters, unsigned portBASE_TYPE uxPriority, xTaskHandle *pxCreatedTask, portSTACK_TYPE *puxStackBuffer, const xMemoryRegion * const xRegions ) PRIVILEGED_FUNCTION;\r
+BaseType_t xTaskGenericCreate( TaskFunction_t pxTaskCode, const char * const pcName, const uint16_t usStackDepth, void * const pvParameters, UBaseType_t uxPriority, TaskHandle_t * const pxCreatedTask, StackType_t * const puxStackBuffer, const MemoryRegion_t * const xRegions ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
 \r
 /*\r
  * Get the uxTCBNumber assigned to the task referenced by the xTask parameter.\r
  */\r
-unsigned portBASE_TYPE uxTaskGetTaskNumber( xTaskHandle xTask );\r
+UBaseType_t uxTaskGetTaskNumber( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;\r
 \r
 /*\r
- * Set the uxTCBNumber of the task referenced by the xTask parameter to\r
- * ucHandle.\r
+ * Set the uxTaskNumber of the task referenced by the xTask parameter to\r
+ * uxHandle.\r
  */\r
-void vTaskSetTaskNumber( xTaskHandle xTask, unsigned portBASE_TYPE uxHandle );\r
+void vTaskSetTaskNumber( TaskHandle_t xTask, const UBaseType_t uxHandle ) PRIVILEGED_FUNCTION;\r
 \r
 /*\r
+ * Only available when configUSE_TICKLESS_IDLE is set to 1.\r
  * If tickless mode is being used, or a low power mode is implemented, then\r
  * the tick interrupt will not execute during idle periods.  When this is the\r
  * case, the tick count value maintained by the scheduler needs to be kept up\r
- * to date with the actual execution time by being skipped forward by the by\r
- * a time equal to the idle period.\r
+ * to date with the actual execution time by being skipped forward by a time\r
+ * equal to the idle period.\r
  */\r
-void vTaskStepTick( portTickType xTicksToJump );\r
+void vTaskStepTick( const TickType_t xTicksToJump ) PRIVILEGED_FUNCTION;\r
 \r
 /*\r
+ * Only avilable when configUSE_TICKLESS_IDLE is set to 1.\r
  * Provided for use within portSUPPRESS_TICKS_AND_SLEEP() to allow the port\r
  * specific sleep function to determine if it is ok to proceed with the sleep,\r
  * and if it is ok to proceed, if it is ok to sleep indefinitely.\r
@@ -1509,7 +1550,13 @@ void vTaskStepTick( portTickType xTicksToJump );
  * critical section between the timer being stopped and the sleep mode being\r
  * entered to ensure it is ok to proceed into the sleep mode.\r
  */\r
-eSleepModeStatus eTaskConfirmSleepModeStatus( void );\r
+eSleepModeStatus eTaskConfirmSleepModeStatus( void ) PRIVILEGED_FUNCTION;\r
+\r
+/*\r
+ * For internal use only.  Increment the mutex held count when a mutex is\r
+ * taken and return the handle of the task that has taken the mutex.\r
+ */\r
+void *pvTaskIncrementMutexHeldCount( void );\r
 \r
 #ifdef __cplusplus\r
 }\r