105 #ifndef INC_FREERTOS_H
106 #error "include FreeRTOS.h must appear in source files before include task.h"
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
181 uint32_t ulLengthInBytes;
182 uint32_t ulParameters;
190 TaskFunction_t pvTaskCode;
191 const char *
const pcName;
192 uint16_t usStackDepth;
230 #define tskIDLE_PRIORITY ( ( UBaseType_t ) 0U )
236 #define taskYIELD() portYIELD()
246 #define taskENTER_CRITICAL() portENTER_CRITICAL()
255 #define taskENTER_CRITICAL_FROM_ISR() portSET_INTERRUPT_MASK_FROM_ISR()
265 #define taskEXIT_CRITICAL() portEXIT_CRITICAL()
274 #define taskEXIT_CRITICAL_FROM_ISR( x ) portCLEAR_INTERRUPT_MASK_FROM_ISR( x )
280 #define taskDISABLE_INTERRUPTS() portDISABLE_INTERRUPTS()
286 #define taskENABLE_INTERRUPTS() portENABLE_INTERRUPTS()
291 #define taskSCHEDULER_SUSPENDED ( ( BaseType_t ) 0 )
292 #define taskSCHEDULER_NOT_STARTED ( ( BaseType_t ) 1 )
293 #define taskSCHEDULER_RUNNING ( ( BaseType_t ) 2 )
383 #if( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
385 const char *
const pcName,
386 const uint16_t usStackDepth,
387 void *
const pvParameters,
489 #if( configSUPPORT_STATIC_ALLOCATION == 1 )
491 const char *
const pcName,
492 const uint32_t ulStackDepth,
493 void *
const pvParameters,
562 #if( portUSING_MPU_WRAPPERS == 1 )
1314 #ifdef configUSE_APPLICATION_TASK_TAG
1315 #if configUSE_APPLICATION_TASK_TAG == 1
1335 #if( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 )
1342 void vTaskSetThreadLocalStoragePointer(
TaskHandle_t xTaskToSet,
BaseType_t xIndex,
void *pvValue) PRIVILEGED_FUNCTION;
1343 void *pvTaskGetThreadLocalStoragePointer(
TaskHandle_t xTaskToQuery,
BaseType_t xIndex) PRIVILEGED_FUNCTION;
1510 void vTaskList(
char *pcWriteBuffer) PRIVILEGED_FUNCTION;
1724 #define xTaskNotify( xTaskToNotify, ulValue, eAction ) xTaskGenericNotify( ( xTaskToNotify ), ( ulValue ), ( eAction ), NULL )
1812 #define xTaskNotifyAndQuery( xTaskToNotify, ulValue, eAction, pulPreviousNotifyValue ) xTaskGenericNotify( ( xTaskToNotify ), ( ulValue ), ( eAction ), ( pulPreviousNotifyValue ) )
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 ) )
1978 BaseType_t xTaskNotifyWait(uint32_t ulBitsToClearOnEntry, uint32_t ulBitsToClearOnExit, uint32_t *pulNotificationValue,
TickType_t xTicksToWait) PRIVILEGED_FUNCTION;
2024 #define xTaskNotifyGive( xTaskToNotify ) xTaskGenericNotify( ( xTaskToNotify ), ( 0 ), eIncrement, NULL )
2079 void vTaskNotifyGiveFromISR(
TaskHandle_t xTaskToNotify,
BaseType_t *pxHigherPriorityTaskWoken) PRIVILEGED_FUNCTION;
2148 uint32_t ulTaskNotifyTake(
BaseType_t xClearCountOnExit,
TickType_t xTicksToWait) PRIVILEGED_FUNCTION;
2185 BaseType_t xTaskIncrementTick(
void) PRIVILEGED_FUNCTION;
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;
2232 void vTaskPlaceOnEventListRestricted(
List_t *
const pxEventList,
TickType_t xTicksToWait,
const BaseType_t xWaitIndefinitely) PRIVILEGED_FUNCTION;
2258 BaseType_t xTaskRemoveFromEventList(
const List_t *
const pxEventList) PRIVILEGED_FUNCTION;
2269 void vTaskSwitchContext(
void) PRIVILEGED_FUNCTION;
2275 TickType_t uxTaskResetEventItemValue(
void) PRIVILEGED_FUNCTION;
2280 TaskHandle_t xTaskGetCurrentTaskHandle(
void) PRIVILEGED_FUNCTION;
2285 void vTaskSetTimeOutState(
TimeOut_t *
const pxTimeOut) PRIVILEGED_FUNCTION;
2297 void vTaskMissedYield(
void) PRIVILEGED_FUNCTION;
2303 BaseType_t xTaskGetSchedulerState(
void) PRIVILEGED_FUNCTION;
2309 void vTaskPriorityInherit(
TaskHandle_t const pxMutexHolder) PRIVILEGED_FUNCTION;
2336 void vTaskStepTick(
const TickType_t xTicksToJump) PRIVILEGED_FUNCTION;
2358 void *pvTaskIncrementMutexHeldCount(
void) PRIVILEGED_FUNCTION;
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.
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
void * TaskHandle_t
Type by which tasks are referenced.
Definition: task.h:132
@ eInvalid
Used as an 'invalid state' value.
Definition: task.h:151
StackType_t * pxStackBase
Points to the lowest address of the task's stack area.
Definition: task.h:212
struct xMEMORY_REGION MemoryRegion_t
@ eReady
The task being queried is in a read or pending ready list.
Definition: task.h:147
@ eDeleted
The task being queried has been deleted, but its TCB has not yet been freed.
Definition: task.h:150
@ eAbortSleep
A task has been made ready or a context switch pended since portSUPPORESS_TICKS_AND_SLEEP() was calle...
Definition: task.h:221
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
The task being queried is in the Suspended state, or is in the Blocked state with an infinite time ou...
Definition: task.h:149
UBaseType_t uxTaskGetNumberOfTasks(void) PRIVILEGED_FUNCTION
Definition: tasks.c:2029
void vTaskResume(TaskHandle_t xTaskToResume) PRIVILEGED_FUNCTION
Resumes a suspended task.
uint32_t TickType_t
FreeRTOS definition for a single tick.
Definition: portmacro.h:98
void vTaskPrioritySet(TaskHandle_t xTask, UBaseType_t uxNewPriority) PRIVILEGED_FUNCTION
Set the priority of any task.
unsigned long UBaseType_t
FreeRTOS definition for unsigned long ints.
Definition: portmacro.h:92
struct xTIME_OUT TimeOut_t
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
Set bits in the task's notification value.
Definition: task.h:160
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
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
long BaseType_t
FreeRTOS definition for long ints.
Definition: portmacro.h:91
@ 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
BaseType_t xTaskResumeFromISR(TaskHandle_t xTaskToResume) PRIVILEGED_FUNCTION
An implementation of vTaskResume() that can be called from within an ISR.
@ eNoAction
Notify the task without updating its notify value.
Definition: task.h:159
char * pcTaskGetName(TaskHandle_t xTaskToQuery) PRIVILEGED_FUNCTION
Definition: tasks.c:2037
TickType_t xTaskGetTickCount(void) PRIVILEGED_FUNCTION
Definition: tasks.c:1983
void vTaskGetRunTimeStats(char *pcWriteBuffer) PRIVILEGED_FUNCTION
Call uxTaskGetSystemState(), then format part of the uxTaskGetSystemState() output into a human reada...
eSleepModeStatus
Definition: task.h:220
void vTaskSuspend(TaskHandle_t xTaskToSuspend) PRIVILEGED_FUNCTION
Suspend any task. When suspended a task will never get any microcontroller processing time,...
BaseType_t(* TaskHookFunction_t)(void *)
Defines the prototype to which the application task hook function must conform.
Definition: task.h:139
@ 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
Actions that can be performed when vTaskNotify() is called.
Definition: task.h:158
eTaskState eCurrentState
The state in which the task existed when the structure was populated.
Definition: task.h:208
@ eStandardSleep
Enter a sleep mode that will not last any longer than the expected idle time.
Definition: task.h:222
UBaseType_t uxCurrentPriority
The priority at which the task was running (may be inherited) when the structure was populated.
Definition: task.h:209
@ eIncrement
Increment the task's notification value.
Definition: task.h:161
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....
void vTaskList(char *pcWriteBuffer) PRIVILEGED_FUNCTION
Lists all the current tasks, along with their current state and stack usage high water mark.
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
TaskHandle_t xHandle
The handle of the task to which the rest of the information in the structure relates.
Definition: task.h:205
BaseType_t xTaskAbortDelay(TaskHandle_t xTask) PRIVILEGED_FUNCTION
@ eRunning
A task is querying the state of itself, so must be running.
Definition: task.h:146
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
UBaseType_t uxTaskPriorityGet(TaskHandle_t xTask) PRIVILEGED_FUNCTION
Obtain the priority of any task.
@ eSetValueWithoutOverwrite
Set the task's notification value if the previous value has been read by the task.
Definition: task.h:163
portSTACK_TYPE StackType_t
FreeRTOS defintions for the Stack Type.
Definition: portmacro.h:90
Definition: FreeRTOS.h:908
struct xTASK_PARAMETERS TaskParameters_t
TaskHandle_t xTaskGetHandle(const char *pcNameToQuery) PRIVILEGED_FUNCTION
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
Task states returned by eTaskGetState.
Definition: task.h:145
BaseType_t xTaskGenericNotify(TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotificationValue) PRIVILEGED_FUNCTION
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...
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
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...
BaseType_t xTaskResumeAll(void) PRIVILEGED_FUNCTION
Resumes scheduler activity after it was suspended by a call to vTaskSuspendAll().
Definition: tasks.c:1886
struct xTASK_STATUS TaskStatus_t
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
The task being queried is in the Blocked state.
Definition: task.h:148
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...
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
TaskHandle_t xTaskGetIdleTaskHandle(void) PRIVILEGED_FUNCTION
eTaskState eTaskGetState(TaskHandle_t xTask) PRIVILEGED_FUNCTION
Obtain the state of any task. States are encoded by the eTaskState enumerated type.
void vTaskSuspendAll(void) PRIVILEGED_FUNCTION
Suspends the scheduler without disabling interrupts. Context switches will not occur while the schedu...
Definition: tasks.c:1819
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...
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...
UBaseType_t xTaskNumber
A number unique to the task.
Definition: task.h:207
UBaseType_t uxTaskPriorityGetFromISR(TaskHandle_t xTask) PRIVILEGED_FUNCTION
A version of uxTaskPriorityGet() that can be used from an ISR.