FreeRTOS Tetris
task.h
1 /*
2  FreeRTOS V9.0.0 - Copyright (C) 2016 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 // Doxygen Groups ***********************************************************************
102 #ifndef INC_TASK_H
103 #define INC_TASK_H
104 
105 #ifndef INC_FREERTOS_H
106 #error "include FreeRTOS.h must appear in source files before include task.h"
107 #endif
108 
109 #include "list.h"
110 
111 #ifdef __cplusplus
112 extern "C" {
113 #endif
114 
115 /*-----------------------------------------------------------
116  * MACROS AND DEFINITIONS
117  *----------------------------------------------------------*/
118 
119 #define tskKERNEL_VERSION_NUMBER "V9.0.0"
120 #define tskKERNEL_VERSION_MAJOR 9
121 #define tskKERNEL_VERSION_MINOR 0
122 #define tskKERNEL_VERSION_BUILD 0
123 
132 typedef void *TaskHandle_t;
133 
139 typedef BaseType_t (*TaskHookFunction_t)(void *);
140 
145 typedef enum {
146  eRunning = 0,
152 } eTaskState;
153 
158 typedef enum {
159  eNoAction = 0,
164 } eNotifyAction;
165 
170 typedef struct xTIME_OUT {
171  BaseType_t xOverflowCount;
172  TickType_t xTimeOnEntering;
173 } TimeOut_t;
174 
179 typedef struct xMEMORY_REGION {
180  void *pvBaseAddress;
181  uint32_t ulLengthInBytes;
182  uint32_t ulParameters;
184 
189 typedef struct xTASK_PARAMETERS {
190  TaskFunction_t pvTaskCode;
191  const char *const pcName; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
192  uint16_t usStackDepth;
193  void *pvParameters;
194  UBaseType_t uxPriority;
195  StackType_t *puxStackBuffer;
196  MemoryRegion_t xRegions[ portNUM_CONFIGURABLE_REGIONS ];
198 
204 typedef struct xTASK_STATUS {
206  const char *pcTaskName;
211  uint32_t ulRunTimeCounter;
214 } TaskStatus_t;
215 
220 typedef enum {
225 
230 #define tskIDLE_PRIORITY ( ( UBaseType_t ) 0U )
231 
236 #define taskYIELD() portYIELD()
237 
246 #define taskENTER_CRITICAL() portENTER_CRITICAL()
247 
255 #define taskENTER_CRITICAL_FROM_ISR() portSET_INTERRUPT_MASK_FROM_ISR()
256 
265 #define taskEXIT_CRITICAL() portEXIT_CRITICAL()
266 
274 #define taskEXIT_CRITICAL_FROM_ISR( x ) portCLEAR_INTERRUPT_MASK_FROM_ISR( x )
275 
280 #define taskDISABLE_INTERRUPTS() portDISABLE_INTERRUPTS()
281 
286 #define taskENABLE_INTERRUPTS() portENABLE_INTERRUPTS()
287 
288 /* Definitions returned by xTaskGetSchedulerState(). taskSCHEDULER_SUSPENDED is
289 0 to generate more optimal code when configASSERT() is defined as the constant
290 is used in assert() statements. */
291 #define taskSCHEDULER_SUSPENDED ( ( BaseType_t ) 0 )
292 #define taskSCHEDULER_NOT_STARTED ( ( BaseType_t ) 1 )
293 #define taskSCHEDULER_RUNNING ( ( BaseType_t ) 2 )
294 
295 
296 /*-----------------------------------------------------------
297  * TASK CREATION API
298  *----------------------------------------------------------*/
299 
383 #if( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
384 BaseType_t xTaskCreate(TaskFunction_t pxTaskCode,
385  const char *const pcName,
386  const uint16_t usStackDepth,
387  void *const pvParameters,
388  UBaseType_t uxPriority,
389  TaskHandle_t *const pxCreatedTask) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
390 #endif
391 
489 #if( configSUPPORT_STATIC_ALLOCATION == 1 )
490 TaskHandle_t xTaskCreateStatic(TaskFunction_t pxTaskCode,
491  const char *const pcName,
492  const uint32_t ulStackDepth,
493  void *const pvParameters,
494  UBaseType_t uxPriority,
495  StackType_t *const puxStackBuffer,
496  StaticTask_t *const pxTaskBuffer) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
497 #endif /* configSUPPORT_STATIC_ALLOCATION */
498 
562 #if( portUSING_MPU_WRAPPERS == 1 )
563 BaseType_t xTaskCreateRestricted(const TaskParameters_t *const pxTaskDefinition, TaskHandle_t *pxCreatedTask) PRIVILEGED_FUNCTION;
564 #endif
565 
608 void vTaskAllocateMPURegions(TaskHandle_t xTask, const MemoryRegion_t *const pxRegions) PRIVILEGED_FUNCTION;
609 
646 void vTaskDelete(TaskHandle_t xTaskToDelete) PRIVILEGED_FUNCTION;
647 
648 /*-----------------------------------------------------------
649  * TASK CONTROL API
650  *----------------------------------------------------------*/
651 
697 void vTaskDelay(const TickType_t xTicksToDelay) PRIVILEGED_FUNCTION;
698 
753 void vTaskDelayUntil(TickType_t *const pxPreviousWakeTime, const TickType_t xTimeIncrement) PRIVILEGED_FUNCTION;
754 
774 BaseType_t xTaskAbortDelay(TaskHandle_t xTask) PRIVILEGED_FUNCTION;
775 
817 UBaseType_t uxTaskPriorityGet(TaskHandle_t xTask) PRIVILEGED_FUNCTION;
818 
823 UBaseType_t uxTaskPriorityGetFromISR(TaskHandle_t xTask) PRIVILEGED_FUNCTION;
824 
840 eTaskState eTaskGetState(TaskHandle_t xTask) PRIVILEGED_FUNCTION;
841 
893 void vTaskGetInfo(TaskHandle_t xTask, TaskStatus_t *pxTaskStatus, BaseType_t xGetFreeStackSpace, eTaskState eState) PRIVILEGED_FUNCTION;
894 
932 void vTaskPrioritySet(TaskHandle_t xTask, UBaseType_t uxNewPriority) PRIVILEGED_FUNCTION;
933 
980 void vTaskSuspend(TaskHandle_t xTaskToSuspend) PRIVILEGED_FUNCTION;
981 
1026 void vTaskResume(TaskHandle_t xTaskToResume) PRIVILEGED_FUNCTION;
1027 
1051 BaseType_t xTaskResumeFromISR(TaskHandle_t xTaskToResume) PRIVILEGED_FUNCTION;
1052 
1053 /*-----------------------------------------------------------
1054  * SCHEDULER CONTROL
1055  *----------------------------------------------------------*/
1056 
1080 void vTaskStartScheduler(void) PRIVILEGED_FUNCTION;
1081 
1132 void vTaskEndScheduler(void) PRIVILEGED_FUNCTION;
1133 
1180 void vTaskSuspendAll(void) PRIVILEGED_FUNCTION;
1181 
1231 BaseType_t xTaskResumeAll(void) PRIVILEGED_FUNCTION;
1232 
1233 /*-----------------------------------------------------------
1234  * TASK UTILITIES
1235  *----------------------------------------------------------*/
1236 
1242 TickType_t xTaskGetTickCount(void) PRIVILEGED_FUNCTION;
1243 
1254 TickType_t xTaskGetTickCountFromISR(void) PRIVILEGED_FUNCTION;
1255 
1264 UBaseType_t uxTaskGetNumberOfTasks(void) PRIVILEGED_FUNCTION;
1265 
1273 char *pcTaskGetName(TaskHandle_t xTaskToQuery) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
1274 
1286 TaskHandle_t xTaskGetHandle(const char *pcNameToQuery) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
1287 
1306 UBaseType_t uxTaskGetStackHighWaterMark(TaskHandle_t xTask) PRIVILEGED_FUNCTION;
1307 
1308 /* When using trace macros it is sometimes necessary to include task.h before
1309 FreeRTOS.h. When this is done TaskHookFunction_t will not yet have been defined,
1310 so the following two prototypes will cause a compilation error. This can be
1311 fixed by simply guarding against the inclusion of these two prototypes unless
1312 they are explicitly required by the configUSE_APPLICATION_TASK_TAG configuration
1313 constant. */
1314 #ifdef configUSE_APPLICATION_TASK_TAG
1315 #if configUSE_APPLICATION_TASK_TAG == 1
1316 
1324 void vTaskSetApplicationTaskTag(TaskHandle_t xTask, TaskHookFunction_t pxHookFunction) PRIVILEGED_FUNCTION;
1325 
1331 TaskHookFunction_t xTaskGetApplicationTaskTag(TaskHandle_t xTask) PRIVILEGED_FUNCTION;
1332 #endif /* configUSE_APPLICATION_TASK_TAG ==1 */
1333 #endif /* ifdef configUSE_APPLICATION_TASK_TAG */
1334 
1335 #if( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 )
1336 
1337 /* Each task contains an array of pointers that is dimensioned by the
1338 configNUM_THREAD_LOCAL_STORAGE_POINTERS setting in FreeRTOSConfig.h. The
1339 kernel does not use the pointers itself, so the application writer can use
1340 the pointers for any purpose they wish. The following two functions are
1341 used to set and query a pointer respectively. */
1342 void vTaskSetThreadLocalStoragePointer(TaskHandle_t xTaskToSet, BaseType_t xIndex, void *pvValue) PRIVILEGED_FUNCTION;
1343 void *pvTaskGetThreadLocalStoragePointer(TaskHandle_t xTaskToQuery, BaseType_t xIndex) PRIVILEGED_FUNCTION;
1344 
1345 #endif
1346 
1357 BaseType_t xTaskCallApplicationTaskHook(TaskHandle_t xTask, void *pvParameter) PRIVILEGED_FUNCTION;
1358 
1368 TaskHandle_t xTaskGetIdleTaskHandle(void) PRIVILEGED_FUNCTION;
1369 
1469 UBaseType_t uxTaskGetSystemState(TaskStatus_t *const pxTaskStatusArray, const UBaseType_t uxArraySize, uint32_t *const pulTotalRunTime) PRIVILEGED_FUNCTION;
1470 
1510 void vTaskList(char *pcWriteBuffer) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
1511 
1557 void vTaskGetRunTimeStats(char *pcWriteBuffer) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
1558 
1632 BaseType_t xTaskGenericNotify(TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotificationValue) PRIVILEGED_FUNCTION;
1633 
1724 #define xTaskNotify( xTaskToNotify, ulValue, eAction ) xTaskGenericNotify( ( xTaskToNotify ), ( ulValue ), ( eAction ), NULL )
1725 
1812 #define xTaskNotifyAndQuery( xTaskToNotify, ulValue, eAction, pulPreviousNotifyValue ) xTaskGenericNotify( ( xTaskToNotify ), ( ulValue ), ( eAction ), ( pulPreviousNotifyValue ) )
1813 
1901 BaseType_t xTaskGenericNotifyFromISR(TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotificationValue, BaseType_t *pxHigherPriorityTaskWoken) PRIVILEGED_FUNCTION;
1902 #define xTaskNotifyFromISR( xTaskToNotify, ulValue, eAction, pxHigherPriorityTaskWoken ) xTaskGenericNotifyFromISR( ( xTaskToNotify ), ( ulValue ), ( eAction ), NULL, ( pxHigherPriorityTaskWoken ) )
1903 #define xTaskNotifyAndQueryFromISR( xTaskToNotify, ulValue, eAction, pulPreviousNotificationValue, pxHigherPriorityTaskWoken ) xTaskGenericNotifyFromISR( ( xTaskToNotify ), ( ulValue ), ( eAction ), ( pulPreviousNotificationValue ), ( pxHigherPriorityTaskWoken ) )
1904 
1978 BaseType_t xTaskNotifyWait(uint32_t ulBitsToClearOnEntry, uint32_t ulBitsToClearOnExit, uint32_t *pulNotificationValue, TickType_t xTicksToWait) PRIVILEGED_FUNCTION;
1979 
2024 #define xTaskNotifyGive( xTaskToNotify ) xTaskGenericNotify( ( xTaskToNotify ), ( 0 ), eIncrement, NULL )
2025 
2079 void vTaskNotifyGiveFromISR(TaskHandle_t xTaskToNotify, BaseType_t *pxHigherPriorityTaskWoken) PRIVILEGED_FUNCTION;
2080 
2148 uint32_t ulTaskNotifyTake(BaseType_t xClearCountOnExit, TickType_t xTicksToWait) PRIVILEGED_FUNCTION;
2149 
2164 BaseType_t xTaskNotifyStateClear(TaskHandle_t xTask);
2165 
2166 /*-----------------------------------------------------------
2167  * SCHEDULER INTERNALS AVAILABLE FOR PORTING PURPOSES
2168  *----------------------------------------------------------*/
2169 
2170 /*
2171  * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS ONLY
2172  * INTENDED FOR USE WHEN IMPLEMENTING A PORT OF THE SCHEDULER AND IS
2173  * AN INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER.
2174  *
2175  * Called from the real time kernel tick (either preemptive or cooperative),
2176  * this increments the tick count and checks if any tasks that are blocked
2177  * for a finite period required removing from a blocked list and placing on
2178  * a ready list. If a non-zero value is returned then a context switch is
2179  * required because either:
2180  * + A task was removed from a blocked list because its timeout had expired,
2181  * or
2182  * + Time slicing is in use and there is a task of equal priority to the
2183  * currently running task.
2184  */
2185 BaseType_t xTaskIncrementTick(void) PRIVILEGED_FUNCTION;
2186 
2218 void vTaskPlaceOnEventList(List_t *const pxEventList, const TickType_t xTicksToWait) PRIVILEGED_FUNCTION;
2219 void vTaskPlaceOnUnorderedEventList(List_t *pxEventList, const TickType_t xItemValue, const TickType_t xTicksToWait) PRIVILEGED_FUNCTION;
2220 
2232 void vTaskPlaceOnEventListRestricted(List_t *const pxEventList, TickType_t xTicksToWait, const BaseType_t xWaitIndefinitely) PRIVILEGED_FUNCTION;
2233 
2258 BaseType_t xTaskRemoveFromEventList(const List_t *const pxEventList) PRIVILEGED_FUNCTION;
2259 BaseType_t xTaskRemoveFromUnorderedEventList(ListItem_t *pxEventListItem, const TickType_t xItemValue) PRIVILEGED_FUNCTION;
2260 
2269 void vTaskSwitchContext(void) PRIVILEGED_FUNCTION;
2270 
2275 TickType_t uxTaskResetEventItemValue(void) PRIVILEGED_FUNCTION;
2276 
2280 TaskHandle_t xTaskGetCurrentTaskHandle(void) PRIVILEGED_FUNCTION;
2281 
2285 void vTaskSetTimeOutState(TimeOut_t *const pxTimeOut) PRIVILEGED_FUNCTION;
2286 
2291 BaseType_t xTaskCheckForTimeOut(TimeOut_t *const pxTimeOut, TickType_t *const pxTicksToWait) PRIVILEGED_FUNCTION;
2292 
2297 void vTaskMissedYield(void) PRIVILEGED_FUNCTION;
2298 
2303 BaseType_t xTaskGetSchedulerState(void) PRIVILEGED_FUNCTION;
2304 
2309 void vTaskPriorityInherit(TaskHandle_t const pxMutexHolder) PRIVILEGED_FUNCTION;
2310 
2315 BaseType_t xTaskPriorityDisinherit(TaskHandle_t const pxMutexHolder) PRIVILEGED_FUNCTION;
2316 
2320 UBaseType_t uxTaskGetTaskNumber(TaskHandle_t xTask) PRIVILEGED_FUNCTION;
2321 
2326 void vTaskSetTaskNumber(TaskHandle_t xTask, const UBaseType_t uxHandle) PRIVILEGED_FUNCTION;
2327 
2336 void vTaskStepTick(const TickType_t xTicksToJump) PRIVILEGED_FUNCTION;
2337 
2352 eSleepModeStatus eTaskConfirmSleepModeStatus(void) PRIVILEGED_FUNCTION;
2353 
2358 void *pvTaskIncrementMutexHeldCount(void) PRIVILEGED_FUNCTION;
2359 
2360 #ifdef __cplusplus
2361 }
2362 #endif
2363 #endif /* INC_TASK_H */
2364 
xTaskCreateStatic
TaskHandle_t xTaskCreateStatic(TaskFunction_t pxTaskCode, const char *const pcName, const uint32_t ulStackDepth, void *const pvParameters, UBaseType_t uxPriority, StackType_t *const puxStackBuffer, StaticTask_t *const pxTaskBuffer) PRIVILEGED_FUNCTION
Create a new task and add it to the list of tasks that are ready to run.
xLIST_ITEM
Definition: list.h:181
xTASK_STATUS::uxBasePriority
UBaseType_t uxBasePriority
The priority to which the task will return if the task's current priority has been inherited to avoid...
Definition: task.h:210
TaskHandle_t
void * TaskHandle_t
Type by which tasks are referenced.
Definition: task.h:132
eInvalid
@ eInvalid
Used as an 'invalid state' value.
Definition: task.h:151
xTASK_STATUS::pxStackBase
StackType_t * pxStackBase
Points to the lowest address of the task's stack area.
Definition: task.h:212
MemoryRegion_t
struct xMEMORY_REGION MemoryRegion_t
eReady
@ eReady
The task being queried is in a read or pending ready list.
Definition: task.h:147
eDeleted
@ eDeleted
The task being queried has been deleted, but its TCB has not yet been freed.
Definition: task.h:150
eAbortSleep
@ eAbortSleep
A task has been made ready or a context switch pended since portSUPPORESS_TICKS_AND_SLEEP() was calle...
Definition: task.h:221
xTASK_STATUS::ulRunTimeCounter
uint32_t ulRunTimeCounter
The total run time allocated to the task so far, as defined by the run time stats clock....
Definition: task.h:211
eSuspended
@ eSuspended
The task being queried is in the Suspended state, or is in the Blocked state with an infinite time ou...
Definition: task.h:149
uxTaskGetNumberOfTasks
UBaseType_t uxTaskGetNumberOfTasks(void) PRIVILEGED_FUNCTION
Definition: tasks.c:2029
vTaskResume
void vTaskResume(TaskHandle_t xTaskToResume) PRIVILEGED_FUNCTION
Resumes a suspended task.
TickType_t
uint32_t TickType_t
FreeRTOS definition for a single tick.
Definition: portmacro.h:98
vTaskPrioritySet
void vTaskPrioritySet(TaskHandle_t xTask, UBaseType_t uxNewPriority) PRIVILEGED_FUNCTION
Set the priority of any task.
UBaseType_t
unsigned long UBaseType_t
FreeRTOS definition for unsigned long ints.
Definition: portmacro.h:92
TimeOut_t
struct xTIME_OUT TimeOut_t
xTaskCreateRestricted
BaseType_t xTaskCreateRestricted(const TaskParameters_t *const pxTaskDefinition, TaskHandle_t *pxCreatedTask) PRIVILEGED_FUNCTION
Create a new task and add it to the list of tasks that are ready to run. The function parameters defi...
Definition: tasks.c:627
eSetBits
@ eSetBits
Set bits in the task's notification value.
Definition: task.h:160
xTASK_STATUS::pcTaskName
const char * pcTaskName
A pointer to the task's name. This value will be invalid if the task was deleted since the structure ...
Definition: task.h:206
xTaskCreate
BaseType_t xTaskCreate(TaskFunction_t pxTaskCode, const char *const pcName, const uint16_t usStackDepth, void *const pvParameters, UBaseType_t uxPriority, TaskHandle_t *const pxCreatedTask) PRIVILEGED_FUNCTION
Create a new task and add it to the list of tasks that are ready to run.
Definition: tasks.c:670
BaseType_t
long BaseType_t
FreeRTOS definition for long ints.
Definition: portmacro.h:91
eSetValueWithOverwrite
@ eSetValueWithOverwrite
Set the task's notification value to a specific value even if the previous value has not yet been rea...
Definition: task.h:162
xTASK_PARAMETERS
Definition: task.h:189
xTaskResumeFromISR
BaseType_t xTaskResumeFromISR(TaskHandle_t xTaskToResume) PRIVILEGED_FUNCTION
An implementation of vTaskResume() that can be called from within an ISR.
eNoAction
@ eNoAction
Notify the task without updating its notify value.
Definition: task.h:159
pcTaskGetName
char * pcTaskGetName(TaskHandle_t xTaskToQuery) PRIVILEGED_FUNCTION
Definition: tasks.c:2037
xTaskGetTickCount
TickType_t xTaskGetTickCount(void) PRIVILEGED_FUNCTION
Definition: tasks.c:1983
vTaskGetRunTimeStats
void vTaskGetRunTimeStats(char *pcWriteBuffer) PRIVILEGED_FUNCTION
Call uxTaskGetSystemState(), then format part of the uxTaskGetSystemState() output into a human reada...
eSleepModeStatus
eSleepModeStatus
Definition: task.h:220
vTaskSuspend
void vTaskSuspend(TaskHandle_t xTaskToSuspend) PRIVILEGED_FUNCTION
Suspend any task. When suspended a task will never get any microcontroller processing time,...
TaskHookFunction_t
BaseType_t(* TaskHookFunction_t)(void *)
Defines the prototype to which the application task hook function must conform.
Definition: task.h:139
eNoTasksWaitingTimeout
@ eNoTasksWaitingTimeout
No tasks are waiting for a timeout so it is safe to enter a sleep mode that can only be exited by an ...
Definition: task.h:223
eNotifyAction
eNotifyAction
Actions that can be performed when vTaskNotify() is called.
Definition: task.h:158
xTASK_STATUS
Definition: task.h:204
xTASK_STATUS::eCurrentState
eTaskState eCurrentState
The state in which the task existed when the structure was populated.
Definition: task.h:208
eStandardSleep
@ eStandardSleep
Enter a sleep mode that will not last any longer than the expected idle time.
Definition: task.h:222
xTASK_STATUS::uxCurrentPriority
UBaseType_t uxCurrentPriority
The priority at which the task was running (may be inherited) when the structure was populated.
Definition: task.h:209
eIncrement
@ eIncrement
Increment the task's notification value.
Definition: task.h:161
uxTaskGetSystemState
UBaseType_t uxTaskGetSystemState(TaskStatus_t *const pxTaskStatusArray, const UBaseType_t uxArraySize, uint32_t *const pulTotalRunTime) PRIVILEGED_FUNCTION
uxTaskGetSystemState() populates an TaskStatus_t structure for each task in the system....
vTaskList
void vTaskList(char *pcWriteBuffer) PRIVILEGED_FUNCTION
Lists all the current tasks, along with their current state and stack usage high water mark.
vTaskStartScheduler
void vTaskStartScheduler(void) PRIVILEGED_FUNCTION
Starts the real time kernel tick processing. After calling the kernel has control over which tasks ar...
Definition: tasks.c:1709
xTASK_STATUS::xHandle
TaskHandle_t xHandle
The handle of the task to which the rest of the information in the structure relates.
Definition: task.h:205
xTaskAbortDelay
BaseType_t xTaskAbortDelay(TaskHandle_t xTask) PRIVILEGED_FUNCTION
eRunning
@ eRunning
A task is querying the state of itself, so must be running.
Definition: task.h:146
vTaskEndScheduler
void vTaskEndScheduler(void) PRIVILEGED_FUNCTION
Stops the real time kernel tick. All created tasks will be automatically deleted and multitasking (ei...
Definition: tasks.c:1808
uxTaskPriorityGet
UBaseType_t uxTaskPriorityGet(TaskHandle_t xTask) PRIVILEGED_FUNCTION
Obtain the priority of any task.
eSetValueWithoutOverwrite
@ eSetValueWithoutOverwrite
Set the task's notification value if the previous value has been read by the task.
Definition: task.h:163
StackType_t
portSTACK_TYPE StackType_t
FreeRTOS defintions for the Stack Type.
Definition: portmacro.h:90
xSTATIC_TCB
Definition: FreeRTOS.h:908
TaskParameters_t
struct xTASK_PARAMETERS TaskParameters_t
xTIME_OUT
Definition: task.h:170
xTaskGetHandle
TaskHandle_t xTaskGetHandle(const char *pcNameToQuery) PRIVILEGED_FUNCTION
vTaskGetInfo
void vTaskGetInfo(TaskHandle_t xTask, TaskStatus_t *pxTaskStatus, BaseType_t xGetFreeStackSpace, eTaskState eState) PRIVILEGED_FUNCTION
Populates a TaskStatus_t structure with information about a task.
eTaskState
eTaskState
Task states returned by eTaskGetState.
Definition: task.h:145
xTaskGenericNotify
BaseType_t xTaskGenericNotify(TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotificationValue) PRIVILEGED_FUNCTION
vTaskDelete
void vTaskDelete(TaskHandle_t xTaskToDelete) PRIVILEGED_FUNCTION
Remove a task from the RTOS real time kernel's management. The task being deleted will be removed fro...
vTaskAllocateMPURegions
void vTaskAllocateMPURegions(TaskHandle_t xTask, const MemoryRegion_t *const pxRegions) PRIVILEGED_FUNCTION
Memory regions are assigned to a restricted task when the task is created by a call to xTaskCreateRes...
Definition: tasks.c:3091
uxTaskGetStackHighWaterMark
UBaseType_t uxTaskGetStackHighWaterMark(TaskHandle_t xTask) PRIVILEGED_FUNCTION
Returns the high water mark of the stack associated with xTask. That is, the minimum free stack space...
xTaskResumeAll
BaseType_t xTaskResumeAll(void) PRIVILEGED_FUNCTION
Resumes scheduler activity after it was suspended by a call to vTaskSuspendAll().
Definition: tasks.c:1886
TaskStatus_t
struct xTASK_STATUS TaskStatus_t
xTASK_STATUS::usStackHighWaterMark
uint16_t usStackHighWaterMark
The minimum amount of stack space that has remained for the task since the task was created....
Definition: task.h:213
eBlocked
@ eBlocked
The task being queried is in the Blocked state.
Definition: task.h:148
vTaskDelayUntil
void vTaskDelayUntil(TickType_t *const pxPreviousWakeTime, const TickType_t xTimeIncrement) PRIVILEGED_FUNCTION
Delay a task until a specified time. This function can be used by periodic tasks to ensure a constant...
xTaskGetTickCountFromISR
TickType_t xTaskGetTickCountFromISR(void) PRIVILEGED_FUNCTION
This is a version of xTaskGetTickCount() that is safe to be called from an ISR - provided that TickTy...
Definition: tasks.c:1998
xMEMORY_REGION
Definition: task.h:179
xTaskGetIdleTaskHandle
TaskHandle_t xTaskGetIdleTaskHandle(void) PRIVILEGED_FUNCTION
eTaskGetState
eTaskState eTaskGetState(TaskHandle_t xTask) PRIVILEGED_FUNCTION
Obtain the state of any task. States are encoded by the eTaskState enumerated type.
vTaskSuspendAll
void vTaskSuspendAll(void) PRIVILEGED_FUNCTION
Suspends the scheduler without disabling interrupts. Context switches will not occur while the schedu...
Definition: tasks.c:1819
vTaskDelay
void vTaskDelay(const TickType_t xTicksToDelay) PRIVILEGED_FUNCTION
Delay a task for a given number of ticks. The actual time that the task remains blocked depends on th...
xTaskCallApplicationTaskHook
BaseType_t xTaskCallApplicationTaskHook(TaskHandle_t xTask, void *pvParameter) PRIVILEGED_FUNCTION
Calls the hook function associated with xTask. Passing xTask as NULL has the effect of calling the Ru...
xTASK_STATUS::xTaskNumber
UBaseType_t xTaskNumber
A number unique to the task.
Definition: task.h:207
xLIST
Definition: list.h:203
uxTaskPriorityGetFromISR
UBaseType_t uxTaskPriorityGetFromISR(TaskHandle_t xTask) PRIVILEGED_FUNCTION
A version of uxTaskPriorityGet() that can be used from an ISR.