Robobo
task.h
1 /*
2  FreeRTOS V8.2.3 - Copyright (C) 2015 Real Time Engineers Ltd.
3  All rights reserved
4 
5  VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
6 
7  This file is part of the FreeRTOS distribution.
8 
9  FreeRTOS is free software; you can redistribute it and/or modify it under
10  the terms of the GNU General Public License (version 2) as published by the
11  Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.
12 
13  ***************************************************************************
14  >>! NOTE: The modification to the GPL is included to allow you to !<<
15  >>! distribute a combined work that includes FreeRTOS without being !<<
16  >>! obliged to provide the source code for proprietary components !<<
17  >>! outside of the FreeRTOS kernel. !<<
18  ***************************************************************************
19 
20  FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
21  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
22  FOR A PARTICULAR PURPOSE. Full license text is available on the following
23  link: http://www.freertos.org/a00114.html
24 
25  ***************************************************************************
26  * *
27  * FreeRTOS provides completely free yet professionally developed, *
28  * robust, strictly quality controlled, supported, and cross *
29  * platform software that is more than just the market leader, it *
30  * is the industry's de facto standard. *
31  * *
32  * Help yourself get started quickly while simultaneously helping *
33  * to support the FreeRTOS project by purchasing a FreeRTOS *
34  * tutorial book, reference manual, or both: *
35  * http://www.FreeRTOS.org/Documentation *
36  * *
37  ***************************************************************************
38 
39  http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading
40  the FAQ page "My application does not run, what could be wrong?". Have you
41  defined configASSERT()?
42 
43  http://www.FreeRTOS.org/support - In return for receiving this top quality
44  embedded software for free we request you assist our global community by
45  participating in the support forum.
46 
47  http://www.FreeRTOS.org/training - Investing in training allows your team to
48  be as productive as possible as early as possible. Now you can receive
49  FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
50  Ltd, and the world's leading authority on the world's leading RTOS.
51 
52  http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
53  including FreeRTOS+Trace - an indispensable productivity tool, a DOS
54  compatible FAT file system, and our tiny thread aware UDP/IP stack.
55 
56  http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
57  Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.
58 
59  http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
60  Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS
61  licenses offer ticketed support, indemnification and commercial middleware.
62 
63  http://www.SafeRTOS.com - High Integrity Systems also provide a safety
64  engineered and independently SIL3 certified version for use in safety and
65  mission critical applications that require provable dependability.
66 
67  1 tab == 4 spaces!
68 */
69 
70 
71 #ifndef INC_TASK_H
72 #define INC_TASK_H
73 
74 #ifndef INC_FREERTOS_H
75  #error "include FreeRTOS.h must appear in source files before include task.h"
76 #endif
77 
78 #include "list.h"
79 
80 #ifdef __cplusplus
81 extern "C" {
82 #endif
83 
84 /*-----------------------------------------------------------
85  * MACROS AND DEFINITIONS
86  *----------------------------------------------------------*/
87 
88 #define tskKERNEL_VERSION_NUMBER "V8.2.3"
89 #define tskKERNEL_VERSION_MAJOR 8
90 #define tskKERNEL_VERSION_MINOR 2
91 #define tskKERNEL_VERSION_BUILD 3
92 
103 typedef void * TaskHandle_t;
104 
105 /*
106  * Defines the prototype to which the application task hook function must
107  * conform.
108  */
109 typedef BaseType_t (*TaskHookFunction_t)( void * );
110 
111 /* Task states returned by eTaskGetState. */
112 typedef enum
113 {
114  eRunning = 0, /* A task is querying the state of itself, so must be running. */
115  eReady, /* The task being queried is in a read or pending ready list. */
116  eBlocked, /* The task being queried is in the Blocked state. */
117  eSuspended, /* The task being queried is in the Suspended state, or is in the Blocked state with an infinite time out. */
118  eDeleted /* The task being queried has been deleted, but its TCB has not yet been freed. */
119 } eTaskState;
120 
121 /* Actions that can be performed when vTaskNotify() is called. */
122 typedef enum
123 {
124  eNoAction = 0, /* Notify the task without updating its notify value. */
125  eSetBits, /* Set bits in the task's notification value. */
126  eIncrement, /* Increment the task's notification value. */
127  eSetValueWithOverwrite, /* Set the task's notification value to a specific value even if the previous value has not yet been read by the task. */
128  eSetValueWithoutOverwrite /* Set the task's notification value if the previous value has been read by the task. */
129 } eNotifyAction;
130 
131 /*
132  * Used internally only.
133  */
134 typedef struct xTIME_OUT
135 {
136  BaseType_t xOverflowCount;
137  TickType_t xTimeOnEntering;
138 } TimeOut_t;
139 
140 /*
141  * Defines the memory ranges allocated to the task when an MPU is used.
142  */
143 typedef struct xMEMORY_REGION
144 {
145  void *pvBaseAddress;
146  uint32_t ulLengthInBytes;
147  uint32_t ulParameters;
149 
150 /*
151  * Parameters required to create an MPU protected task.
152  */
153 typedef struct xTASK_PARAMETERS
154 {
155  TaskFunction_t pvTaskCode;
156  const char * const pcName; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
157  uint16_t usStackDepth;
158  void *pvParameters;
159  UBaseType_t uxPriority;
160  StackType_t *puxStackBuffer;
161  MemoryRegion_t xRegions[ portNUM_CONFIGURABLE_REGIONS ];
163 
164 /* Used with the uxTaskGetSystemState() function to return the state of each task
165 in the system. */
166 typedef struct xTASK_STATUS
167 {
168  TaskHandle_t xHandle; /* The handle of the task to which the rest of the information in the structure relates. */
169  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. */
170  UBaseType_t xTaskNumber; /* A number unique to the task. */
171  eTaskState eCurrentState; /* The state in which the task existed when the structure was populated. */
172  UBaseType_t uxCurrentPriority; /* The priority at which the task was running (may be inherited) when the structure was populated. */
173  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. */
174  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. */
175  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. */
176 } TaskStatus_t;
177 
178 /* Possible return values for eTaskConfirmSleepModeStatus(). */
179 typedef enum
180 {
181  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. */
182  eStandardSleep, /* Enter a sleep mode that will not last any longer than the expected idle time. */
183  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. */
184 } eSleepModeStatus;
185 
186 
192 #define tskIDLE_PRIORITY ( ( UBaseType_t ) 0U )
193 
202 #define taskYIELD() portYIELD()
203 
216 #define taskENTER_CRITICAL() portENTER_CRITICAL()
217 #define taskENTER_CRITICAL_FROM_ISR() portSET_INTERRUPT_MASK_FROM_ISR()
218 
231 #define taskEXIT_CRITICAL() portEXIT_CRITICAL()
232 #define taskEXIT_CRITICAL_FROM_ISR( x ) portCLEAR_INTERRUPT_MASK_FROM_ISR( x )
233 
241 #define taskDISABLE_INTERRUPTS() portDISABLE_INTERRUPTS()
242 
251 #define taskENABLE_INTERRUPTS() portENABLE_INTERRUPTS()
252 
253 /* Definitions returned by xTaskGetSchedulerState(). taskSCHEDULER_SUSPENDED is
254 0 to generate more optimal code when configASSERT() is defined as the constant
255 is used in assert() statements. */
256 #define taskSCHEDULER_SUSPENDED ( ( BaseType_t ) 0 )
257 #define taskSCHEDULER_NOT_STARTED ( ( BaseType_t ) 1 )
258 #define taskSCHEDULER_RUNNING ( ( BaseType_t ) 2 )
259 
260 
261 /*-----------------------------------------------------------
262  * TASK CREATION API
263  *----------------------------------------------------------*/
264 
345 #define xTaskCreate( pvTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pxCreatedTask ) xTaskGenericCreate( ( pvTaskCode ), ( pcName ), ( usStackDepth ), ( pvParameters ), ( uxPriority ), ( pxCreatedTask ), ( NULL ), ( NULL ) )
346 
414 #define xTaskCreateRestricted( x, pxCreatedTask ) xTaskGenericCreate( ((x)->pvTaskCode), ((x)->pcName), ((x)->usStackDepth), ((x)->pvParameters), ((x)->uxPriority), (pxCreatedTask), ((x)->puxStackBuffer), ((x)->xRegions) )
415 
462 void vTaskAllocateMPURegions( TaskHandle_t xTask, const MemoryRegion_t * const pxRegions ) PRIVILEGED_FUNCTION;
463 
503 void vTaskDelete( TaskHandle_t xTaskToDelete ) PRIVILEGED_FUNCTION;
504 
505 /*-----------------------------------------------------------
506  * TASK CONTROL API
507  *----------------------------------------------------------*/
508 
555 void vTaskDelay( const TickType_t xTicksToDelay ) PRIVILEGED_FUNCTION;
556 
614 void vTaskDelayUntil( TickType_t * const pxPreviousWakeTime, const TickType_t xTimeIncrement ) PRIVILEGED_FUNCTION;
615 
661 UBaseType_t uxTaskPriorityGet( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
662 
669 UBaseType_t uxTaskPriorityGetFromISR( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
670 
687 eTaskState eTaskGetState( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
688 
729 void vTaskPrioritySet( TaskHandle_t xTask, UBaseType_t uxNewPriority ) PRIVILEGED_FUNCTION;
730 
780 void vTaskSuspend( TaskHandle_t xTaskToSuspend ) PRIVILEGED_FUNCTION;
781 
829 void vTaskResume( TaskHandle_t xTaskToResume ) PRIVILEGED_FUNCTION;
830 
858 BaseType_t xTaskResumeFromISR( TaskHandle_t xTaskToResume ) PRIVILEGED_FUNCTION;
859 
860 /*-----------------------------------------------------------
861  * SCHEDULER CONTROL
862  *----------------------------------------------------------*/
863 
891 void vTaskStartScheduler( void ) PRIVILEGED_FUNCTION;
892 
947 void vTaskEndScheduler( void ) PRIVILEGED_FUNCTION;
948 
998 void vTaskSuspendAll( void ) PRIVILEGED_FUNCTION;
999 
1052 BaseType_t xTaskResumeAll( void ) PRIVILEGED_FUNCTION;
1053 
1054 /*-----------------------------------------------------------
1055  * TASK UTILITIES
1056  *----------------------------------------------------------*/
1057 
1067 TickType_t xTaskGetTickCount( void ) PRIVILEGED_FUNCTION;
1068 
1083 TickType_t xTaskGetTickCountFromISR( void ) PRIVILEGED_FUNCTION;
1084 
1097 UBaseType_t uxTaskGetNumberOfTasks( void ) PRIVILEGED_FUNCTION;
1098 
1111 char *pcTaskGetTaskName( TaskHandle_t xTaskToQuery ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
1112 
1132 UBaseType_t uxTaskGetStackHighWaterMark( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
1133 
1134 /* When using trace macros it is sometimes necessary to include task.h before
1135 FreeRTOS.h. When this is done TaskHookFunction_t will not yet have been defined,
1136 so the following two prototypes will cause a compilation error. This can be
1137 fixed by simply guarding against the inclusion of these two prototypes unless
1138 they are explicitly required by the configUSE_APPLICATION_TASK_TAG configuration
1139 constant. */
1140 #ifdef configUSE_APPLICATION_TASK_TAG
1141  #if configUSE_APPLICATION_TASK_TAG == 1
1142 
1150  void vTaskSetApplicationTaskTag( TaskHandle_t xTask, TaskHookFunction_t pxHookFunction ) PRIVILEGED_FUNCTION;
1151 
1158  TaskHookFunction_t xTaskGetApplicationTaskTag( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
1159  #endif /* configUSE_APPLICATION_TASK_TAG ==1 */
1160 #endif /* ifdef configUSE_APPLICATION_TASK_TAG */
1161 
1162 #if( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 )
1163 
1164  /* Each task contains an array of pointers that is dimensioned by the
1165  configNUM_THREAD_LOCAL_STORAGE_POINTERS setting in FreeRTOSConfig.h. The
1166  kernel does not use the pointers itself, so the application writer can use
1167  the pointers for any purpose they wish. The following two functions are
1168  used to set and query a pointer respectively. */
1169  void vTaskSetThreadLocalStoragePointer( TaskHandle_t xTaskToSet, BaseType_t xIndex, void *pvValue ) PRIVILEGED_FUNCTION;
1170  void *pvTaskGetThreadLocalStoragePointer( TaskHandle_t xTaskToQuery, BaseType_t xIndex ) PRIVILEGED_FUNCTION;
1171 
1172 #endif
1173 
1185 BaseType_t xTaskCallApplicationTaskHook( TaskHandle_t xTask, void *pvParameter ) PRIVILEGED_FUNCTION;
1186 
1194 TaskHandle_t xTaskGetIdleTaskHandle( void ) PRIVILEGED_FUNCTION;
1195 
1293 UBaseType_t uxTaskGetSystemState( TaskStatus_t * const pxTaskStatusArray, const UBaseType_t uxArraySize, uint32_t * const pulTotalRunTime ) PRIVILEGED_FUNCTION;
1294 
1340 void vTaskList( char * pcWriteBuffer ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
1341 
1394 void vTaskGetRunTimeStats( char *pcWriteBuffer ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
1395 
1475 BaseType_t xTaskGenericNotify( TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotificationValue ) PRIVILEGED_FUNCTION;
1476 #define xTaskNotify( xTaskToNotify, ulValue, eAction ) xTaskGenericNotify( ( xTaskToNotify ), ( ulValue ), ( eAction ), NULL )
1477 #define xTaskNotifyAndQuery( xTaskToNotify, ulValue, eAction, pulPreviousNotifyValue ) xTaskGenericNotify( ( xTaskToNotify ), ( ulValue ), ( eAction ), ( pulPreviousNotifyValue ) )
1478 
1566 BaseType_t xTaskGenericNotifyFromISR( TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotificationValue, BaseType_t *pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
1567 #define xTaskNotifyFromISR( xTaskToNotify, ulValue, eAction, pxHigherPriorityTaskWoken ) xTaskGenericNotifyFromISR( ( xTaskToNotify ), ( ulValue ), ( eAction ), NULL, ( pxHigherPriorityTaskWoken ) )
1568 #define xTaskNotifyAndQueryFromISR( xTaskToNotify, ulValue, eAction, pulPreviousNotificationValue, pxHigherPriorityTaskWoken ) xTaskGenericNotifyFromISR( ( xTaskToNotify ), ( ulValue ), ( eAction ), ( pulPreviousNotificationValue ), ( pxHigherPriorityTaskWoken ) )
1569 
1643 BaseType_t xTaskNotifyWait( uint32_t ulBitsToClearOnEntry, uint32_t ulBitsToClearOnExit, uint32_t *pulNotificationValue, TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
1644 
1689 #define xTaskNotifyGive( xTaskToNotify ) xTaskGenericNotify( ( xTaskToNotify ), ( 0 ), eIncrement, NULL )
1690 
1744 void vTaskNotifyGiveFromISR( TaskHandle_t xTaskToNotify, BaseType_t *pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
1745 
1813 uint32_t ulTaskNotifyTake( BaseType_t xClearCountOnExit, TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
1814 
1829 BaseType_t xTaskNotifyStateClear( TaskHandle_t xTask );
1830 
1831 /*-----------------------------------------------------------
1832  * SCHEDULER INTERNALS AVAILABLE FOR PORTING PURPOSES
1833  *----------------------------------------------------------*/
1834 
1835 /*
1836  * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS ONLY
1837  * INTENDED FOR USE WHEN IMPLEMENTING A PORT OF THE SCHEDULER AND IS
1838  * AN INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER.
1839  *
1840  * Called from the real time kernel tick (either preemptive or cooperative),
1841  * this increments the tick count and checks if any tasks that are blocked
1842  * for a finite period required removing from a blocked list and placing on
1843  * a ready list. If a non-zero value is returned then a context switch is
1844  * required because either:
1845  * + A task was removed from a blocked list because its timeout had expired,
1846  * or
1847  * + Time slicing is in use and there is a task of equal priority to the
1848  * currently running task.
1849  */
1850 BaseType_t xTaskIncrementTick( void ) PRIVILEGED_FUNCTION;
1851 
1852 /*
1853  * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS AN
1854  * INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER.
1855  *
1856  * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED.
1857  *
1858  * Removes the calling task from the ready list and places it both
1859  * on the list of tasks waiting for a particular event, and the
1860  * list of delayed tasks. The task will be removed from both lists
1861  * and replaced on the ready list should either the event occur (and
1862  * there be no higher priority tasks waiting on the same event) or
1863  * the delay period expires.
1864  *
1865  * The 'unordered' version replaces the event list item value with the
1866  * xItemValue value, and inserts the list item at the end of the list.
1867  *
1868  * The 'ordered' version uses the existing event list item value (which is the
1869  * owning tasks priority) to insert the list item into the event list is task
1870  * priority order.
1871  *
1872  * @param pxEventList The list containing tasks that are blocked waiting
1873  * for the event to occur.
1874  *
1875  * @param xItemValue The item value to use for the event list item when the
1876  * event list is not ordered by task priority.
1877  *
1878  * @param xTicksToWait The maximum amount of time that the task should wait
1879  * for the event to occur. This is specified in kernel ticks,the constant
1880  * portTICK_PERIOD_MS can be used to convert kernel ticks into a real time
1881  * period.
1882  */
1883 void vTaskPlaceOnEventList( List_t * const pxEventList, const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
1884 void vTaskPlaceOnUnorderedEventList( List_t * pxEventList, const TickType_t xItemValue, const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
1885 
1886 /*
1887  * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS AN
1888  * INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER.
1889  *
1890  * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED.
1891  *
1892  * This function performs nearly the same function as vTaskPlaceOnEventList().
1893  * The difference being that this function does not permit tasks to block
1894  * indefinitely, whereas vTaskPlaceOnEventList() does.
1895  *
1896  */
1897 void vTaskPlaceOnEventListRestricted( List_t * const pxEventList, const TickType_t xTicksToWait, const BaseType_t xWaitIndefinitely ) PRIVILEGED_FUNCTION;
1898 
1899 /*
1900  * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS AN
1901  * INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER.
1902  *
1903  * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED.
1904  *
1905  * Removes a task from both the specified event list and the list of blocked
1906  * tasks, and places it on a ready queue.
1907  *
1908  * xTaskRemoveFromEventList()/xTaskRemoveFromUnorderedEventList() will be called
1909  * if either an event occurs to unblock a task, or the block timeout period
1910  * expires.
1911  *
1912  * xTaskRemoveFromEventList() is used when the event list is in task priority
1913  * order. It removes the list item from the head of the event list as that will
1914  * have the highest priority owning task of all the tasks on the event list.
1915  * xTaskRemoveFromUnorderedEventList() is used when the event list is not
1916  * ordered and the event list items hold something other than the owning tasks
1917  * priority. In this case the event list item value is updated to the value
1918  * passed in the xItemValue parameter.
1919  *
1920  * @return pdTRUE if the task being removed has a higher priority than the task
1921  * making the call, otherwise pdFALSE.
1922  */
1923 BaseType_t xTaskRemoveFromEventList( const List_t * const pxEventList ) PRIVILEGED_FUNCTION;
1924 BaseType_t xTaskRemoveFromUnorderedEventList( ListItem_t * pxEventListItem, const TickType_t xItemValue ) PRIVILEGED_FUNCTION;
1925 
1926 /*
1927  * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS ONLY
1928  * INTENDED FOR USE WHEN IMPLEMENTING A PORT OF THE SCHEDULER AND IS
1929  * AN INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER.
1930  *
1931  * Sets the pointer to the current TCB to the TCB of the highest priority task
1932  * that is ready to run.
1933  */
1934 void vTaskSwitchContext( void ) PRIVILEGED_FUNCTION;
1935 
1936 /*
1937  * THESE FUNCTIONS MUST NOT BE USED FROM APPLICATION CODE. THEY ARE USED BY
1938  * THE EVENT BITS MODULE.
1939  */
1940 TickType_t uxTaskResetEventItemValue( void ) PRIVILEGED_FUNCTION;
1941 
1942 /*
1943  * Return the handle of the calling task.
1944  */
1945 TaskHandle_t xTaskGetCurrentTaskHandle( void ) PRIVILEGED_FUNCTION;
1946 
1947 /*
1948  * Capture the current time status for future reference.
1949  */
1950 void vTaskSetTimeOutState( TimeOut_t * const pxTimeOut ) PRIVILEGED_FUNCTION;
1951 
1952 /*
1953  * Compare the time status now with that previously captured to see if the
1954  * timeout has expired.
1955  */
1956 BaseType_t xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut, TickType_t * const pxTicksToWait ) PRIVILEGED_FUNCTION;
1957 
1958 /*
1959  * Shortcut used by the queue implementation to prevent unnecessary call to
1960  * taskYIELD();
1961  */
1962 void vTaskMissedYield( void ) PRIVILEGED_FUNCTION;
1963 
1964 /*
1965  * Returns the scheduler state as taskSCHEDULER_RUNNING,
1966  * taskSCHEDULER_NOT_STARTED or taskSCHEDULER_SUSPENDED.
1967  */
1968 BaseType_t xTaskGetSchedulerState( void ) PRIVILEGED_FUNCTION;
1969 
1970 /*
1971  * Raises the priority of the mutex holder to that of the calling task should
1972  * the mutex holder have a priority less than the calling task.
1973  */
1974 void vTaskPriorityInherit( TaskHandle_t const pxMutexHolder ) PRIVILEGED_FUNCTION;
1975 
1976 /*
1977  * Set the priority of a task back to its proper priority in the case that it
1978  * inherited a higher priority while it was holding a semaphore.
1979  */
1980 BaseType_t xTaskPriorityDisinherit( TaskHandle_t const pxMutexHolder ) PRIVILEGED_FUNCTION;
1981 
1982 /*
1983  * Generic version of the task creation function which is in turn called by the
1984  * xTaskCreate() and xTaskCreateRestricted() macros.
1985  */
1986 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. */
1987 
1988 /*
1989  * Get the uxTCBNumber assigned to the task referenced by the xTask parameter.
1990  */
1991 UBaseType_t uxTaskGetTaskNumber( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
1992 
1993 /*
1994  * Set the uxTaskNumber of the task referenced by the xTask parameter to
1995  * uxHandle.
1996  */
1997 void vTaskSetTaskNumber( TaskHandle_t xTask, const UBaseType_t uxHandle ) PRIVILEGED_FUNCTION;
1998 
1999 /*
2000  * Only available when configUSE_TICKLESS_IDLE is set to 1.
2001  * If tickless mode is being used, or a low power mode is implemented, then
2002  * the tick interrupt will not execute during idle periods. When this is the
2003  * case, the tick count value maintained by the scheduler needs to be kept up
2004  * to date with the actual execution time by being skipped forward by a time
2005  * equal to the idle period.
2006  */
2007 void vTaskStepTick( const TickType_t xTicksToJump ) PRIVILEGED_FUNCTION;
2008 
2009 /*
2010  * Only avilable when configUSE_TICKLESS_IDLE is set to 1.
2011  * Provided for use within portSUPPRESS_TICKS_AND_SLEEP() to allow the port
2012  * specific sleep function to determine if it is ok to proceed with the sleep,
2013  * and if it is ok to proceed, if it is ok to sleep indefinitely.
2014  *
2015  * This function is necessary because portSUPPRESS_TICKS_AND_SLEEP() is only
2016  * called with the scheduler suspended, not from within a critical section. It
2017  * is therefore possible for an interrupt to request a context switch between
2018  * portSUPPRESS_TICKS_AND_SLEEP() and the low power mode actually being
2019  * entered. eTaskConfirmSleepModeStatus() should be called from a short
2020  * critical section between the timer being stopped and the sleep mode being
2021  * entered to ensure it is ok to proceed into the sleep mode.
2022  */
2023 eSleepModeStatus eTaskConfirmSleepModeStatus( void ) PRIVILEGED_FUNCTION;
2024 
2025 /*
2026  * For internal use only. Increment the mutex held count when a mutex is
2027  * taken and return the handle of the task that has taken the mutex.
2028  */
2029 void *pvTaskIncrementMutexHeldCount( void ) PRIVILEGED_FUNCTION;
2030 
2031 #ifdef __cplusplus
2032 }
2033 #endif
2034 #endif /* INC_TASK_H */
2035 
2036 
2037 
Definition: task.h:166
Definition: task.h:143
Definition: task.h:153
Definition: list.h:181
Definition: task.h:134
Definition: list.h:205