task.h
Go to the documentation of this file.
1 /*
2  * FreeRTOS Kernel V10.0.0
3  * Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a copy of
6  * this software and associated documentation files (the "Software"), to deal in
7  * the Software without restriction, including without limitation the rights to
8  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9  * the Software, and to permit persons to whom the Software is furnished to do so,
10  * subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included in all
13  * copies or substantial portions of the Software. If you wish to use our Amazon
14  * FreeRTOS name, please do so in a fair use way that does not cause confusion.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22  *
23  * http://www.FreeRTOS.org
24  * http://aws.amazon.com/freertos
25  *
26  * 1 tab == 4 spaces!
27  */
28 
29 
30 #ifndef INC_TASK_H
31 #define INC_TASK_H
32 
33 #ifndef INC_FREERTOS_H
34  #error "include FreeRTOS.h must appear in source files before include task.h"
35 #endif
36 
37 #include "list.h"
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 /*-----------------------------------------------------------
44  * MACROS AND DEFINITIONS
45  *----------------------------------------------------------*/
46 
47 #define tskKERNEL_VERSION_NUMBER "V9.0.0"
48 #define tskKERNEL_VERSION_MAJOR 9
49 #define tskKERNEL_VERSION_MINOR 0
50 #define tskKERNEL_VERSION_BUILD 0
51 
62 typedef void * TaskHandle_t;
63 
64 /*
65  * Defines the prototype to which the application task hook function must
66  * conform.
67  */
68 typedef BaseType_t (*TaskHookFunction_t)( void * );
69 
70 /* Task states returned by eTaskGetState. */
71 typedef enum
72 {
73  eRunning = 0, /* A task is querying the state of itself, so must be running. */
74  eReady, /* The task being queried is in a read or pending ready list. */
75  eBlocked, /* The task being queried is in the Blocked state. */
76  eSuspended, /* The task being queried is in the Suspended state, or is in the Blocked state with an infinite time out. */
77  eDeleted, /* The task being queried has been deleted, but its TCB has not yet been freed. */
78  eInvalid /* Used as an 'invalid state' value. */
79 } eTaskState;
80 
81 /* Actions that can be performed when vTaskNotify() is called. */
82 typedef enum
83 {
84  eNoAction = 0, /* Notify the task without updating its notify value. */
85  eSetBits, /* Set bits in the task's notification value. */
86  eIncrement, /* Increment the task's notification value. */
87  eSetValueWithOverwrite, /* Set the task's notification value to a specific value even if the previous value has not yet been read by the task. */
88  eSetValueWithoutOverwrite /* Set the task's notification value if the previous value has been read by the task. */
90 
91 /*
92  * Used internally only.
93  */
94 typedef struct xTIME_OUT
95 {
98 } TimeOut_t;
99 
100 /*
101  * Defines the memory ranges allocated to the task when an MPU is used.
102  */
103 typedef struct xMEMORY_REGION
104 {
106  uint32_t ulLengthInBytes;
107  uint32_t ulParameters;
109 
110 /*
111  * Parameters required to create an MPU protected task.
112  */
113 typedef struct xTASK_PARAMETERS
114 {
116  const char * const pcName; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
117  uint16_t usStackDepth;
122  #if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) )
123  StaticTask_t * const pxTaskBuffer;
124  #endif
126 
127 /* Used with the uxTaskGetSystemState() function to return the state of each task
128 in the system. */
129 typedef struct xTASK_STATUS
130 {
131  TaskHandle_t xHandle; /* The handle of the task to which the rest of the information in the structure relates. */
132  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. */
133  UBaseType_t xTaskNumber; /* A number unique to the task. */
134  eTaskState eCurrentState; /* The state in which the task existed when the structure was populated. */
135  UBaseType_t uxCurrentPriority; /* The priority at which the task was running (may be inherited) when the structure was populated. */
136  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. */
137  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. */
138  StackType_t *pxStackBase; /* Points to the lowest address of the task's stack area. */
139  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. */
140 } TaskStatus_t;
141 
142 /* Possible return values for eTaskConfirmSleepModeStatus(). */
143 typedef enum
144 {
145  eAbortSleep = 0, /* A task has been made ready or a context switch pended since portSUPPORESS_TICKS_AND_SLEEP() was called - abort entering a sleep mode. */
146  eStandardSleep, /* Enter a sleep mode that will not last any longer than the expected idle time. */
147  eNoTasksWaitingTimeout /* No tasks are waiting for a timeout so it is safe to enter a sleep mode that can only be exited by an external interrupt. */
149 
155 #define tskIDLE_PRIORITY ( ( UBaseType_t ) 0U )
156 
165 #define taskYIELD() portYIELD()
166 
179 #define taskENTER_CRITICAL() portENTER_CRITICAL()
180 #define taskENTER_CRITICAL_FROM_ISR() portSET_INTERRUPT_MASK_FROM_ISR()
181 
194 #define taskEXIT_CRITICAL() portEXIT_CRITICAL()
195 #define taskEXIT_CRITICAL_FROM_ISR( x ) portCLEAR_INTERRUPT_MASK_FROM_ISR( x )
196 
204 #define taskDISABLE_INTERRUPTS() portDISABLE_INTERRUPTS()
205 
214 #define taskENABLE_INTERRUPTS() portENABLE_INTERRUPTS()
215 
216 /* Definitions returned by xTaskGetSchedulerState(). taskSCHEDULER_SUSPENDED is
217 0 to generate more optimal code when configASSERT() is defined as the constant
218 is used in assert() statements. */
219 #define taskSCHEDULER_SUSPENDED ( ( BaseType_t ) 0 )
220 #define taskSCHEDULER_NOT_STARTED ( ( BaseType_t ) 1 )
221 #define taskSCHEDULER_RUNNING ( ( BaseType_t ) 2 )
222 
223 
224 /*-----------------------------------------------------------
225  * TASK CREATION API
226  *----------------------------------------------------------*/
227 
321 #if( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
322  BaseType_t xTaskCreate( TaskFunction_t pxTaskCode,
323  const char * const pcName, /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
324  const configSTACK_DEPTH_TYPE usStackDepth,
325  void * const pvParameters,
326  UBaseType_t uxPriority,
327  TaskHandle_t * const pxCreatedTask ) PRIVILEGED_FUNCTION;
328 #endif
329 
437 #if( configSUPPORT_STATIC_ALLOCATION == 1 )
438  TaskHandle_t xTaskCreateStatic( TaskFunction_t pxTaskCode,
439  const char * const pcName, /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
440  const uint32_t ulStackDepth,
441  void * const pvParameters,
442  UBaseType_t uxPriority,
443  StackType_t * const puxStackBuffer,
444  StaticTask_t * const pxTaskBuffer ) PRIVILEGED_FUNCTION;
445 #endif /* configSUPPORT_STATIC_ALLOCATION */
446 
519 #if( portUSING_MPU_WRAPPERS == 1 )
520  BaseType_t xTaskCreateRestricted( const TaskParameters_t * const pxTaskDefinition, TaskHandle_t *pxCreatedTask ) PRIVILEGED_FUNCTION;
521 #endif
522 
607 #if( ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) )
608  BaseType_t xTaskCreateRestrictedStatic( const TaskParameters_t * const pxTaskDefinition, TaskHandle_t *pxCreatedTask ) PRIVILEGED_FUNCTION;
609 #endif
610 
657 void vTaskAllocateMPURegions( TaskHandle_t xTask, const MemoryRegion_t * const pxRegions ) PRIVILEGED_FUNCTION;
658 
698 void vTaskDelete( TaskHandle_t xTaskToDelete ) PRIVILEGED_FUNCTION;
699 
700 /*-----------------------------------------------------------
701  * TASK CONTROL API
702  *----------------------------------------------------------*/
703 
750 void vTaskDelay( const TickType_t xTicksToDelay ) PRIVILEGED_FUNCTION;
751 
809 void vTaskDelayUntil( TickType_t * const pxPreviousWakeTime, const TickType_t xTimeIncrement ) PRIVILEGED_FUNCTION;
810 
834 BaseType_t xTaskAbortDelay( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
835 
882 
890 
907 eTaskState eTaskGetState( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
908 
963 void vTaskGetInfo( TaskHandle_t xTask, TaskStatus_t *pxTaskStatus, BaseType_t xGetFreeStackSpace, eTaskState eState ) PRIVILEGED_FUNCTION;
964 
1005 void vTaskPrioritySet( TaskHandle_t xTask, UBaseType_t uxNewPriority ) PRIVILEGED_FUNCTION;
1006 
1056 void vTaskSuspend( TaskHandle_t xTaskToSuspend ) PRIVILEGED_FUNCTION;
1057 
1105 void vTaskResume( TaskHandle_t xTaskToResume ) PRIVILEGED_FUNCTION;
1106 
1134 BaseType_t xTaskResumeFromISR( TaskHandle_t xTaskToResume ) PRIVILEGED_FUNCTION;
1135 
1136 /*-----------------------------------------------------------
1137  * SCHEDULER CONTROL
1138  *----------------------------------------------------------*/
1139 
1167 void vTaskStartScheduler( TaskHandle_t* idleTaskHandle, TaskHandle_t* timerTaskHandle ) PRIVILEGED_FUNCTION;
1168 
1224 
1275 
1329 
1330 /*-----------------------------------------------------------
1331  * TASK UTILITIES
1332  *----------------------------------------------------------*/
1333 
1344 
1360 
1374 
1386 char *pcTaskGetName( TaskHandle_t xTaskToQuery ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
1387 
1402 TaskHandle_t xTaskGetHandle( const char *pcNameToQuery ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
1403 
1424 
1425 /* When using trace macros it is sometimes necessary to include task.h before
1426 FreeRTOS.h. When this is done TaskHookFunction_t will not yet have been defined,
1427 so the following two prototypes will cause a compilation error. This can be
1428 fixed by simply guarding against the inclusion of these two prototypes unless
1429 they are explicitly required by the configUSE_APPLICATION_TASK_TAG configuration
1430 constant. */
1431 #ifdef configUSE_APPLICATION_TASK_TAG
1432  #if configUSE_APPLICATION_TASK_TAG == 1
1433 
1441  void vTaskSetApplicationTaskTag( TaskHandle_t xTask, TaskHookFunction_t pxHookFunction ) PRIVILEGED_FUNCTION;
1442 
1449  TaskHookFunction_t xTaskGetApplicationTaskTag( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
1450  #endif /* configUSE_APPLICATION_TASK_TAG ==1 */
1451 #endif /* ifdef configUSE_APPLICATION_TASK_TAG */
1452 
1453 #if( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 )
1454 
1455  /* Each task contains an array of pointers that is dimensioned by the
1456  configNUM_THREAD_LOCAL_STORAGE_POINTERS setting in FreeRTOSConfig.h. The
1457  kernel does not use the pointers itself, so the application writer can use
1458  the pointers for any purpose they wish. The following two functions are
1459  used to set and query a pointer respectively. */
1460  void vTaskSetThreadLocalStoragePointer( TaskHandle_t xTaskToSet, BaseType_t xIndex, void *pvValue ) PRIVILEGED_FUNCTION;
1461  void *pvTaskGetThreadLocalStoragePointer( TaskHandle_t xTaskToQuery, BaseType_t xIndex ) PRIVILEGED_FUNCTION;
1462 
1463 #endif
1464 
1476 BaseType_t xTaskCallApplicationTaskHook( TaskHandle_t xTask, void *pvParameter ) PRIVILEGED_FUNCTION;
1477 
1485 TaskHandle_t xTaskGetIdleTaskHandle( void ) PRIVILEGED_FUNCTION;
1486 
1584 UBaseType_t uxTaskGetSystemState( TaskStatus_t * const pxTaskStatusArray, const UBaseType_t uxArraySize, uint32_t * const pulTotalRunTime ) PRIVILEGED_FUNCTION;
1585 
1631 void vTaskList( char * pcWriteBuffer ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
1632 
1685 void vTaskGetRunTimeStats( char *pcWriteBuffer ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
1686 
1766 BaseType_t xTaskGenericNotify( TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotificationValue ) PRIVILEGED_FUNCTION;
1767 #define xTaskNotify( xTaskToNotify, ulValue, eAction ) xTaskGenericNotify( ( xTaskToNotify ), ( ulValue ), ( eAction ), NULL )
1768 #define xTaskNotifyAndQuery( xTaskToNotify, ulValue, eAction, pulPreviousNotifyValue ) xTaskGenericNotify( ( xTaskToNotify ), ( ulValue ), ( eAction ), ( pulPreviousNotifyValue ) )
1769 
1857 BaseType_t xTaskGenericNotifyFromISR( TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotificationValue, BaseType_t *pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
1858 #define xTaskNotifyFromISR( xTaskToNotify, ulValue, eAction, pxHigherPriorityTaskWoken ) xTaskGenericNotifyFromISR( ( xTaskToNotify ), ( ulValue ), ( eAction ), NULL, ( pxHigherPriorityTaskWoken ) )
1859 #define xTaskNotifyAndQueryFromISR( xTaskToNotify, ulValue, eAction, pulPreviousNotificationValue, pxHigherPriorityTaskWoken ) xTaskGenericNotifyFromISR( ( xTaskToNotify ), ( ulValue ), ( eAction ), ( pulPreviousNotificationValue ), ( pxHigherPriorityTaskWoken ) )
1860 
1934 BaseType_t xTaskNotifyWait( uint32_t ulBitsToClearOnEntry, uint32_t ulBitsToClearOnExit, uint32_t *pulNotificationValue, TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
1935 
1980 #define xTaskNotifyGive( xTaskToNotify ) xTaskGenericNotify( ( xTaskToNotify ), ( 0 ), eIncrement, NULL )
1981 
2035 void vTaskNotifyGiveFromISR( TaskHandle_t xTaskToNotify, BaseType_t *pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
2036 
2104 uint32_t ulTaskNotifyTake( BaseType_t xClearCountOnExit, TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
2105 
2120 BaseType_t xTaskNotifyStateClear( TaskHandle_t xTask );
2121 
2122 /*-----------------------------------------------------------
2123  * SCHEDULER INTERNALS AVAILABLE FOR PORTING PURPOSES
2124  *----------------------------------------------------------*/
2125 
2126 /*
2127  * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS ONLY
2128  * INTENDED FOR USE WHEN IMPLEMENTING A PORT OF THE SCHEDULER AND IS
2129  * AN INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER.
2130  *
2131  * Called from the real time kernel tick (either preemptive or cooperative),
2132  * this increments the tick count and checks if any tasks that are blocked
2133  * for a finite period required removing from a blocked list and placing on
2134  * a ready list. If a non-zero value is returned then a context switch is
2135  * required because either:
2136  * + A task was removed from a blocked list because its timeout had expired,
2137  * or
2138  * + Time slicing is in use and there is a task of equal priority to the
2139  * currently running task.
2140  */
2142 
2143 /*
2144  * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS AN
2145  * INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER.
2146  *
2147  * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED.
2148  *
2149  * Removes the calling task from the ready list and places it both
2150  * on the list of tasks waiting for a particular event, and the
2151  * list of delayed tasks. The task will be removed from both lists
2152  * and replaced on the ready list should either the event occur (and
2153  * there be no higher priority tasks waiting on the same event) or
2154  * the delay period expires.
2155  *
2156  * The 'unordered' version replaces the event list item value with the
2157  * xItemValue value, and inserts the list item at the end of the list.
2158  *
2159  * The 'ordered' version uses the existing event list item value (which is the
2160  * owning tasks priority) to insert the list item into the event list is task
2161  * priority order.
2162  *
2163  * @param pxEventList The list containing tasks that are blocked waiting
2164  * for the event to occur.
2165  *
2166  * @param xItemValue The item value to use for the event list item when the
2167  * event list is not ordered by task priority.
2168  *
2169  * @param xTicksToWait The maximum amount of time that the task should wait
2170  * for the event to occur. This is specified in kernel ticks,the constant
2171  * portTICK_PERIOD_MS can be used to convert kernel ticks into a real time
2172  * period.
2173  */
2174 void vTaskPlaceOnEventList( List_t * const pxEventList, const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
2175 void vTaskPlaceOnUnorderedEventList( List_t * pxEventList, const TickType_t xItemValue, const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
2176 
2177 /*
2178  * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS AN
2179  * INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER.
2180  *
2181  * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED.
2182  *
2183  * This function performs nearly the same function as vTaskPlaceOnEventList().
2184  * The difference being that this function does not permit tasks to block
2185  * indefinitely, whereas vTaskPlaceOnEventList() does.
2186  *
2187  */
2188 void vTaskPlaceOnEventListRestricted( List_t * const pxEventList, TickType_t xTicksToWait, const BaseType_t xWaitIndefinitely ) PRIVILEGED_FUNCTION;
2189 
2190 /*
2191  * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS AN
2192  * INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER.
2193  *
2194  * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED.
2195  *
2196  * Removes a task from both the specified event list and the list of blocked
2197  * tasks, and places it on a ready queue.
2198  *
2199  * xTaskRemoveFromEventList()/vTaskRemoveFromUnorderedEventList() will be called
2200  * if either an event occurs to unblock a task, or the block timeout period
2201  * expires.
2202  *
2203  * xTaskRemoveFromEventList() is used when the event list is in task priority
2204  * order. It removes the list item from the head of the event list as that will
2205  * have the highest priority owning task of all the tasks on the event list.
2206  * vTaskRemoveFromUnorderedEventList() is used when the event list is not
2207  * ordered and the event list items hold something other than the owning tasks
2208  * priority. In this case the event list item value is updated to the value
2209  * passed in the xItemValue parameter.
2210  *
2211  * @return pdTRUE if the task being removed has a higher priority than the task
2212  * making the call, otherwise pdFALSE.
2213  */
2214 BaseType_t xTaskRemoveFromEventList( const List_t * const pxEventList ) PRIVILEGED_FUNCTION;
2215 void vTaskRemoveFromUnorderedEventList( ListItem_t * pxEventListItem, const TickType_t xItemValue ) PRIVILEGED_FUNCTION;
2216 
2217 /*
2218  * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS ONLY
2219  * INTENDED FOR USE WHEN IMPLEMENTING A PORT OF THE SCHEDULER AND IS
2220  * AN INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER.
2221  *
2222  * Sets the pointer to the current TCB to the TCB of the highest priority task
2223  * that is ready to run.
2224  */
2226 
2227 /*
2228  * THESE FUNCTIONS MUST NOT BE USED FROM APPLICATION CODE. THEY ARE USED BY
2229  * THE EVENT BITS MODULE.
2230  */
2232 
2233 /*
2234  * Return the handle of the calling task.
2235  */
2236 TaskHandle_t xTaskGetCurrentTaskHandle( void ) PRIVILEGED_FUNCTION;
2237 
2238 /*
2239  * Capture the current time status for future reference.
2240  */
2241 void vTaskSetTimeOutState( TimeOut_t * const pxTimeOut ) PRIVILEGED_FUNCTION;
2242 
2243 /*
2244  * Compare the time status now with that previously captured to see if the
2245  * timeout has expired.
2246  */
2247 BaseType_t xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut, TickType_t * const pxTicksToWait ) PRIVILEGED_FUNCTION;
2248 
2249 /*
2250  * Shortcut used by the queue implementation to prevent unnecessary call to
2251  * taskYIELD();
2252  */
2254 
2255 /*
2256  * Returns the scheduler state as taskSCHEDULER_RUNNING,
2257  * taskSCHEDULER_NOT_STARTED or taskSCHEDULER_SUSPENDED.
2258  */
2260 
2261 /*
2262  * Raises the priority of the mutex holder to that of the calling task should
2263  * the mutex holder have a priority less than the calling task.
2264  */
2266 
2267 /*
2268  * Set the priority of a task back to its proper priority in the case that it
2269  * inherited a higher priority while it was holding a semaphore.
2270  */
2272 
2273 /*
2274  * If a higher priority task attempting to obtain a mutex caused a lower
2275  * priority task to inherit the higher priority task's priority - but the higher
2276  * priority task then timed out without obtaining the mutex, then the lower
2277  * priority task will disinherit the priority again - but only down as far as
2278  * the highest priority task that is still waiting for the mutex (if there were
2279  * more than one task waiting for the mutex).
2280  */
2281 void vTaskPriorityDisinheritAfterTimeout( TaskHandle_t const pxMutexHolder, UBaseType_t uxHighestPriorityWaitingTask ) PRIVILEGED_FUNCTION;
2282 
2283 /*
2284  * Get the uxTCBNumber assigned to the task referenced by the xTask parameter.
2285  */
2287 
2288 /*
2289  * Set the uxTaskNumber of the task referenced by the xTask parameter to
2290  * uxHandle.
2291  */
2292 void vTaskSetTaskNumber( TaskHandle_t xTask, const UBaseType_t uxHandle ) PRIVILEGED_FUNCTION;
2293 
2294 /*
2295  * Only available when configUSE_TICKLESS_IDLE is set to 1.
2296  * If tickless mode is being used, or a low power mode is implemented, then
2297  * the tick interrupt will not execute during idle periods. When this is the
2298  * case, the tick count value maintained by the scheduler needs to be kept up
2299  * to date with the actual execution time by being skipped forward by a time
2300  * equal to the idle period.
2301  */
2302 void vTaskStepTick( const TickType_t xTicksToJump ) PRIVILEGED_FUNCTION;
2303 
2304 /*
2305  * Only avilable when configUSE_TICKLESS_IDLE is set to 1.
2306  * Provided for use within portSUPPRESS_TICKS_AND_SLEEP() to allow the port
2307  * specific sleep function to determine if it is ok to proceed with the sleep,
2308  * and if it is ok to proceed, if it is ok to sleep indefinitely.
2309  *
2310  * This function is necessary because portSUPPRESS_TICKS_AND_SLEEP() is only
2311  * called with the scheduler suspended, not from within a critical section. It
2312  * is therefore possible for an interrupt to request a context switch between
2313  * portSUPPRESS_TICKS_AND_SLEEP() and the low power mode actually being
2314  * entered. eTaskConfirmSleepModeStatus() should be called from a short
2315  * critical section between the timer being stopped and the sleep mode being
2316  * entered to ensure it is ok to proceed into the sleep mode.
2317  */
2318 eSleepModeStatus eTaskConfirmSleepModeStatus( void ) PRIVILEGED_FUNCTION;
2319 
2320 /*
2321  * For internal use only. Increment the mutex held count when a mutex is
2322  * taken and return the handle of the task that has taken the mutex.
2323  */
2325 
2326 /*
2327  * For internal use only. Same as vTaskSetTimeOutState(), but without a critial
2328  * section.
2329  */
2331 
2332 
2333 #ifdef __cplusplus
2334 }
2335 #endif
2336 #endif /* INC_TASK_H */
2337 
2338 
2339 
UBaseType_t uxCurrentPriority
Definition: task.h:135
#define pxMutexHolder
Definition: queue.c:67
UBaseType_t uxPriority
Definition: task.h:119
void vTaskSwitchContext(void) PRIVILEGED_FUNCTION
Definition: tasks.c:2853
TaskHandle_t xTaskGetHandle(const char *pcNameToQuery) PRIVILEGED_FUNCTION
eTaskState eCurrentState
Definition: task.h:134
void vTaskStartScheduler(TaskHandle_t *idleTaskHandle, TaskHandle_t *timerTaskHandle) PRIVILEGED_FUNCTION
Definition: tasks.c:1901
uint32_t ulRunTimeCounter
Definition: task.h:137
UBaseType_t uxTaskPriorityGetFromISR(TaskHandle_t xTask) PRIVILEGED_FUNCTION
void * pvBaseAddress
Definition: task.h:105
Definition: list.h:164
uint16_t usStackHighWaterMark
Definition: task.h:139
void vTaskSetTaskNumber(TaskHandle_t xTask, const UBaseType_t uxHandle) PRIVILEGED_FUNCTION
Definition: task.h:84
void vTaskGetRunTimeStats(char *pcWriteBuffer) PRIVILEGED_FUNCTION
TickType_t xTimeOnEntering
Definition: task.h:97
TaskHandle_t xTaskGetCurrentTaskHandle(void) PRIVILEGED_FUNCTION
Definition: task.h:78
void vTaskPrioritySet(TaskHandle_t xTask, UBaseType_t uxNewPriority) PRIVILEGED_FUNCTION
void vTaskSuspendAll(void) PRIVILEGED_FUNCTION
Definition: tasks.c:2034
Definition: task.h:73
Definition: task.h:77
struct xTIME_OUT TimeOut_t
StackType_t * pxStackBase
Definition: task.h:138
BaseType_t xTaskPriorityInherit(TaskHandle_t const pxMutexHolder) PRIVILEGED_FUNCTION
void * pvTaskIncrementMutexHeldCount(void) PRIVILEGED_FUNCTION
eNotifyAction
Definition: task.h:82
BaseType_t xTaskResumeFromISR(TaskHandle_t xTaskToResume) PRIVILEGED_FUNCTION
void vTaskPlaceOnEventListRestricted(List_t *const pxEventList, TickType_t xTicksToWait, const BaseType_t xWaitIndefinitely) PRIVILEGED_FUNCTION
BaseType_t xTaskCallApplicationTaskHook(TaskHandle_t xTask, void *pvParameter) PRIVILEGED_FUNCTION
void vTaskList(char *pcWriteBuffer) PRIVILEGED_FUNCTION
Definition: task.h:74
void vTaskPlaceOnUnorderedEventList(List_t *pxEventList, const TickType_t xItemValue, const TickType_t xTicksToWait) PRIVILEGED_FUNCTION
Definition: tasks.c:2929
BaseType_t xTaskAbortDelay(TaskHandle_t xTask) PRIVILEGED_FUNCTION
uint32_t ulLengthInBytes
Definition: task.h:106
BaseType_t xTaskGenericNotifyFromISR(TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotificationValue, BaseType_t *pxHigherPriorityTaskWoken) PRIVILEGED_FUNCTION
unsigned long UBaseType_t
Definition: portmacro.h:58
uint32_t TickType_t
Definition: portmacro.h:64
const char * pcTaskName
Definition: task.h:132
void vTaskStepTick(const TickType_t xTicksToJump) PRIVILEGED_FUNCTION
eTaskState
Definition: task.h:71
struct xMEMORY_REGION MemoryRegion_t
BaseType_t xTaskNotifyWait(uint32_t ulBitsToClearOnEntry, uint32_t ulBitsToClearOnExit, uint32_t *pulNotificationValue, TickType_t xTicksToWait) PRIVILEGED_FUNCTION
Definition: task.h:94
UBaseType_t uxTaskPriorityGet(TaskHandle_t xTask) PRIVILEGED_FUNCTION
TickType_t xTaskGetTickCountFromISR(void) PRIVILEGED_FUNCTION
Definition: tasks.c:2232
void vTaskPriorityDisinheritAfterTimeout(TaskHandle_t const pxMutexHolder, UBaseType_t uxHighestPriorityWaitingTask) PRIVILEGED_FUNCTION
BaseType_t(* TaskHookFunction_t)(void *)
Definition: task.h:68
void vTaskEndScheduler(void) PRIVILEGED_FUNCTION
Definition: tasks.c:2023
Definition: task.h:85
TickType_t xTaskGetTickCount(void) PRIVILEGED_FUNCTION
Definition: tasks.c:2217
void vTaskDelete(TaskHandle_t xTaskToDelete) PRIVILEGED_FUNCTION
UBaseType_t uxTaskGetTaskNumber(TaskHandle_t xTask) PRIVILEGED_FUNCTION
BaseType_t xTaskPriorityDisinherit(TaskHandle_t const pxMutexHolder) PRIVILEGED_FUNCTION
void vTaskMissedYield(void) PRIVILEGED_FUNCTION
Definition: tasks.c:3171
UBaseType_t uxTaskGetStackHighWaterMark(TaskHandle_t xTask) PRIVILEGED_FUNCTION
void vTaskDelayUntil(TickType_t *const pxPreviousWakeTime, const TickType_t xTimeIncrement) PRIVILEGED_FUNCTION
long BaseType_t
Definition: portmacro.h:57
void vTaskSuspend(TaskHandle_t xTaskToSuspend) PRIVILEGED_FUNCTION
TaskHandle_t xTaskGetIdleTaskHandle(void) PRIVILEGED_FUNCTION
#define portNUM_CONFIGURABLE_REGIONS
Definition: portable.h:85
void * pvParameters
Definition: task.h:118
void * TaskHandle_t
Definition: task.h:62
UBaseType_t uxTaskGetNumberOfTasks(void) PRIVILEGED_FUNCTION
Definition: tasks.c:2263
TaskHandle_t xHandle
Definition: task.h:131
TickType_t uxTaskResetEventItemValue(void) PRIVILEGED_FUNCTION
Definition: tasks.c:4388
struct xTASK_STATUS TaskStatus_t
void vTaskNotifyGiveFromISR(TaskHandle_t xTaskToNotify, BaseType_t *pxHigherPriorityTaskWoken) PRIVILEGED_FUNCTION
const char *const pcName
Definition: task.h:116
BaseType_t xTaskNotifyStateClear(TaskHandle_t xTask)
#define configSTACK_DEPTH_TYPE
Definition: FreeRTOS.h:827
eSleepModeStatus
Definition: task.h:143
void vTaskResume(TaskHandle_t xTaskToResume) PRIVILEGED_FUNCTION
void vTaskAllocateMPURegions(TaskHandle_t xTask, const MemoryRegion_t *const pxRegions) PRIVILEGED_FUNCTION
BaseType_t xTaskIncrementTick(void) PRIVILEGED_FUNCTION
Definition: tasks.c:2591
BaseType_t xTaskResumeAll(void) PRIVILEGED_FUNCTION
Definition: tasks.c:2107
BaseType_t xTaskGetSchedulerState(void) PRIVILEGED_FUNCTION
struct xTASK_PARAMETERS TaskParameters_t
uint16_t usStackDepth
Definition: task.h:117
uint32_t ulParameters
Definition: task.h:107
void vTaskSetTimeOutState(TimeOut_t *const pxTimeOut) PRIVILEGED_FUNCTION
Definition: tasks.c:3088
eSleepModeStatus eTaskConfirmSleepModeStatus(void) PRIVILEGED_FUNCTION
uint32_t ulTaskNotifyTake(BaseType_t xClearCountOnExit, TickType_t xTicksToWait) PRIVILEGED_FUNCTION
#define PRIVILEGED_FUNCTION
Definition: mpu_wrappers.h:174
void vTaskDelay(const TickType_t xTicksToDelay) PRIVILEGED_FUNCTION
Definition: task.h:75
UBaseType_t uxBasePriority
Definition: task.h:136
BaseType_t xOverflowCount
Definition: task.h:96
UBaseType_t xTaskNumber
Definition: task.h:133
BaseType_t xTaskCheckForTimeOut(TimeOut_t *const pxTimeOut, TickType_t *const pxTicksToWait) PRIVILEGED_FUNCTION
Definition: tasks.c:3108
TaskFunction_t pvTaskCode
Definition: task.h:115
UBaseType_t uxTaskGetSystemState(TaskStatus_t *const pxTaskStatusArray, const UBaseType_t uxArraySize, uint32_t *const pulTotalRunTime) PRIVILEGED_FUNCTION
void vTaskGetInfo(TaskHandle_t xTask, TaskStatus_t *pxTaskStatus, BaseType_t xGetFreeStackSpace, eTaskState eState) PRIVILEGED_FUNCTION
BaseType_t xTaskGenericNotify(TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotificationValue) PRIVILEGED_FUNCTION
void vTaskRemoveFromUnorderedEventList(ListItem_t *pxEventListItem, const TickType_t xItemValue) PRIVILEGED_FUNCTION
Definition: tasks.c:3054
void(* TaskFunction_t)(void *)
Definition: projdefs.h:36
BaseType_t xTaskRemoveFromEventList(const List_t *const pxEventList) PRIVILEGED_FUNCTION
Definition: tasks.c:2986
void vTaskPlaceOnEventList(List_t *const pxEventList, const TickType_t xTicksToWait) PRIVILEGED_FUNCTION
Definition: tasks.c:2912
StackType_t * puxStackBuffer
Definition: task.h:120
char * pcTaskGetName(TaskHandle_t xTaskToQuery) PRIVILEGED_FUNCTION
Definition: tasks.c:2271
void vTaskInternalSetTimeOutState(TimeOut_t *const pxTimeOut) PRIVILEGED_FUNCTION
Definition: tasks.c:3100
eTaskState eTaskGetState(TaskHandle_t xTask) PRIVILEGED_FUNCTION
portSTACK_TYPE StackType_t
Definition: portmacro.h:56


inertial_sense_ros
Author(s):
autogenerated on Sat Sep 19 2020 03:19:05