33#error "include FreeRTOS.h must appear in source files before include task.h"
46#define tskKERNEL_VERSION_NUMBER "V9.0.0"
47#define tskKERNEL_VERSION_MAJOR 9
48#define tskKERNEL_VERSION_MINOR 0
49#define tskKERNEL_VERSION_BUILD 0
61typedef void *TaskHandle_t;
67typedef BaseType_t (*TaskHookFunction_t)(
void *);
85 eSetValueWithOverwrite,
87 eSetValueWithoutOverwrite
94 BaseType_t xOverflowCount;
95 TickType_t xTimeOnEntering;
102 void * pvBaseAddress;
103 uint32_t ulLengthInBytes;
104 uint32_t ulParameters;
111 TaskFunction_t pvTaskCode;
112 const char *
const pcName;
113 uint16_t usStackDepth;
115 UBaseType_t uxPriority;
116 StackType_t * puxStackBuffer;
118#if ((portUSING_MPU_WRAPPERS == 1) && (configSUPPORT_STATIC_ALLOCATION == 1))
126 TaskHandle_t xHandle;
127 const char * pcTaskName;
129 UBaseType_t xTaskNumber;
130 eTaskState eCurrentState;
131 UBaseType_t uxCurrentPriority;
133 UBaseType_t uxBasePriority;
136 uint32_t ulRunTimeCounter;
139 StackType_t *pxStackBase;
140 uint16_t usStackHighWaterMark;
151 eNoTasksWaitingTimeout
160#define tskIDLE_PRIORITY ((UBaseType_t)0U)
170#define taskYIELD() portYIELD()
184#define taskENTER_CRITICAL() portENTER_CRITICAL()
185#define taskENTER_CRITICAL_FROM_ISR() portSET_INTERRUPT_MASK_FROM_ISR()
199#define taskEXIT_CRITICAL() portEXIT_CRITICAL()
200#define taskEXIT_CRITICAL_FROM_ISR(x) portCLEAR_INTERRUPT_MASK_FROM_ISR(x)
209#define taskDISABLE_INTERRUPTS() portDISABLE_INTERRUPTS()
219#define taskENABLE_INTERRUPTS() portENABLE_INTERRUPTS()
224#define taskSCHEDULER_SUSPENDED ((BaseType_t)0)
225#define taskSCHEDULER_NOT_STARTED ((BaseType_t)1)
226#define taskSCHEDULER_RUNNING ((BaseType_t)2)
325#if (configSUPPORT_DYNAMIC_ALLOCATION == 1)
326BaseType_t xTaskCreate(
327 TaskFunction_t pxTaskCode,
328 const char *
const pcName,
329 const configSTACK_DEPTH_TYPE usStackDepth,
void *
const pvParameters, UBaseType_t uxPriority,
330 TaskHandle_t *
const pxCreatedTask) PRIVILEGED_FUNCTION;
440#if (configSUPPORT_STATIC_ALLOCATION == 1)
441TaskHandle_t xTaskCreateStatic(
442 TaskFunction_t pxTaskCode,
443 const char *
const pcName,
444 const uint32_t ulStackDepth,
void *
const pvParameters, UBaseType_t uxPriority, StackType_t *
const puxStackBuffer,
520#if (portUSING_MPU_WRAPPERS == 1)
521BaseType_t xTaskCreateRestricted(
const TaskParameters_t *
const pxTaskDefinition,
522 TaskHandle_t * pxCreatedTask) PRIVILEGED_FUNCTION;
609#if ((portUSING_MPU_WRAPPERS == 1) && (configSUPPORT_STATIC_ALLOCATION == 1))
610BaseType_t xTaskCreateRestrictedStatic(
const TaskParameters_t *
const pxTaskDefinition,
611 TaskHandle_t * pxCreatedTask) PRIVILEGED_FUNCTION;
660void vTaskAllocateMPURegions(TaskHandle_t xTask,
const MemoryRegion_t *
const pxRegions) PRIVILEGED_FUNCTION;
701void vTaskDelete(TaskHandle_t xTaskToDelete) PRIVILEGED_FUNCTION;
753void vTaskDelay(
const TickType_t xTicksToDelay) PRIVILEGED_FUNCTION;
812void vTaskDelayUntil(TickType_t *
const pxPreviousWakeTime,
const TickType_t xTimeIncrement) PRIVILEGED_FUNCTION;
837BaseType_t xTaskAbortDelay(TaskHandle_t xTask) PRIVILEGED_FUNCTION;
884UBaseType_t uxTaskPriorityGet(TaskHandle_t xTask) PRIVILEGED_FUNCTION;
892UBaseType_t uxTaskPriorityGetFromISR(TaskHandle_t xTask) PRIVILEGED_FUNCTION;
910eTaskState eTaskGetState(TaskHandle_t xTask) PRIVILEGED_FUNCTION;
966void vTaskGetInfo(TaskHandle_t xTask,
TaskStatus_t *pxTaskStatus, BaseType_t xGetFreeStackSpace,
967 eTaskState eState) PRIVILEGED_FUNCTION;
1009void vTaskPrioritySet(TaskHandle_t xTask, UBaseType_t uxNewPriority) PRIVILEGED_FUNCTION;
1059void vTaskSuspend(TaskHandle_t xTaskToSuspend) PRIVILEGED_FUNCTION;
1107void vTaskResume(TaskHandle_t xTaskToResume) PRIVILEGED_FUNCTION;
1136BaseType_t xTaskResumeFromISR(TaskHandle_t xTaskToResume) PRIVILEGED_FUNCTION;
1169void vTaskStartScheduler(
void) PRIVILEGED_FUNCTION;
1225void vTaskEndScheduler(
void) PRIVILEGED_FUNCTION;
1276void vTaskSuspendAll(
void) PRIVILEGED_FUNCTION;
1330BaseType_t xTaskResumeAll(
void) PRIVILEGED_FUNCTION;
1345TickType_t xTaskGetTickCount(
void) PRIVILEGED_FUNCTION;
1361TickType_t xTaskGetTickCountFromISR(
void) PRIVILEGED_FUNCTION;
1375UBaseType_t uxTaskGetNumberOfTasks(
void) PRIVILEGED_FUNCTION;
1388char *pcTaskGetName(TaskHandle_t xTaskToQuery)
1389 PRIVILEGED_FUNCTION;
1405TaskHandle_t xTaskGetHandle(
const char *pcNameToQuery)
1406 PRIVILEGED_FUNCTION;
1427UBaseType_t uxTaskGetStackHighWaterMark(TaskHandle_t xTask) PRIVILEGED_FUNCTION;
1435#ifdef configUSE_APPLICATION_TASK_TAG
1436#if configUSE_APPLICATION_TASK_TAG == 1
1445void vTaskSetApplicationTaskTag(TaskHandle_t xTask, TaskHookFunction_t pxHookFunction) PRIVILEGED_FUNCTION;
1453TaskHookFunction_t xTaskGetApplicationTaskTag(TaskHandle_t xTask) PRIVILEGED_FUNCTION;
1457#if (configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0)
1464void vTaskSetThreadLocalStoragePointer(TaskHandle_t xTaskToSet, BaseType_t xIndex,
void *pvValue) PRIVILEGED_FUNCTION;
1465void *pvTaskGetThreadLocalStoragePointer(TaskHandle_t xTaskToQuery, BaseType_t xIndex) PRIVILEGED_FUNCTION;
1480BaseType_t xTaskCallApplicationTaskHook(TaskHandle_t xTask,
void *pvParameter) PRIVILEGED_FUNCTION;
1489TaskHandle_t xTaskGetIdleTaskHandle(
void) PRIVILEGED_FUNCTION;
1590UBaseType_t uxTaskGetSystemState(
TaskStatus_t *
const pxTaskStatusArray,
const UBaseType_t uxArraySize,
1591 uint32_t *
const pulTotalRunTime) PRIVILEGED_FUNCTION;
1638void vTaskList(
char *pcWriteBuffer)
1639 PRIVILEGED_FUNCTION;
1693void vTaskGetRunTimeStats(
char *pcWriteBuffer)
1694 PRIVILEGED_FUNCTION;
1775BaseType_t xTaskGenericNotify(TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction,
1776 uint32_t *pulPreviousNotificationValue) PRIVILEGED_FUNCTION;
1777#define xTaskNotify(xTaskToNotify, ulValue, eAction) xTaskGenericNotify((xTaskToNotify), (ulValue), (eAction), NULL)
1778#define xTaskNotifyAndQuery(xTaskToNotify, ulValue, eAction, pulPreviousNotifyValue) \
1779 xTaskGenericNotify((xTaskToNotify), (ulValue), (eAction), (pulPreviousNotifyValue))
1868BaseType_t xTaskGenericNotifyFromISR(TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction,
1869 uint32_t * pulPreviousNotificationValue,
1870 BaseType_t *pxHigherPriorityTaskWoken) PRIVILEGED_FUNCTION;
1871#define xTaskNotifyFromISR(xTaskToNotify, ulValue, eAction, pxHigherPriorityTaskWoken) \
1872 xTaskGenericNotifyFromISR((xTaskToNotify), (ulValue), (eAction), NULL, (pxHigherPriorityTaskWoken))
1873#define xTaskNotifyAndQueryFromISR( \
1874 xTaskToNotify, ulValue, eAction, pulPreviousNotificationValue, pxHigherPriorityTaskWoken) \
1875 xTaskGenericNotifyFromISR( \
1876 (xTaskToNotify), (ulValue), (eAction), (pulPreviousNotificationValue), (pxHigherPriorityTaskWoken))
1951BaseType_t xTaskNotifyWait(uint32_t ulBitsToClearOnEntry, uint32_t ulBitsToClearOnExit, uint32_t *pulNotificationValue,
1952 TickType_t xTicksToWait) PRIVILEGED_FUNCTION;
1998#define xTaskNotifyGive(xTaskToNotify) xTaskGenericNotify((xTaskToNotify), (0), eIncrement, NULL)
2053void vTaskNotifyGiveFromISR(TaskHandle_t xTaskToNotify, BaseType_t *pxHigherPriorityTaskWoken) PRIVILEGED_FUNCTION;
2122uint32_t ulTaskNotifyTake(BaseType_t xClearCountOnExit, TickType_t xTicksToWait) PRIVILEGED_FUNCTION;
2138BaseType_t xTaskNotifyStateClear(TaskHandle_t xTask);
2159BaseType_t xTaskIncrementTick(
void) PRIVILEGED_FUNCTION;
2192void vTaskPlaceOnEventList(
List_t *
const pxEventList,
const TickType_t xTicksToWait) PRIVILEGED_FUNCTION;
2193void vTaskPlaceOnUnorderedEventList(
List_t *pxEventList,
const TickType_t xItemValue,
2194 const TickType_t xTicksToWait) PRIVILEGED_FUNCTION;
2207void vTaskPlaceOnEventListRestricted(
List_t *
const pxEventList, TickType_t xTicksToWait,
2208 const BaseType_t xWaitIndefinitely) PRIVILEGED_FUNCTION;
2234BaseType_t xTaskRemoveFromEventList(
const List_t *
const pxEventList) PRIVILEGED_FUNCTION;
2235void vTaskRemoveFromUnorderedEventList(
ListItem_t *pxEventListItem,
const TickType_t xItemValue) PRIVILEGED_FUNCTION;
2245void vTaskSwitchContext(
void) PRIVILEGED_FUNCTION;
2251TickType_t uxTaskResetEventItemValue(
void) PRIVILEGED_FUNCTION;
2256TaskHandle_t xTaskGetCurrentTaskHandle(
void) PRIVILEGED_FUNCTION;
2261void vTaskSetTimeOutState(
TimeOut_t *
const pxTimeOut) PRIVILEGED_FUNCTION;
2267BaseType_t xTaskCheckForTimeOut(
TimeOut_t *
const pxTimeOut, TickType_t *
const pxTicksToWait) PRIVILEGED_FUNCTION;
2273void vTaskMissedYield(
void) PRIVILEGED_FUNCTION;
2279BaseType_t xTaskGetSchedulerState(
void) PRIVILEGED_FUNCTION;
2285BaseType_t xTaskPriorityInherit(TaskHandle_t
const pxMutexHolder) PRIVILEGED_FUNCTION;
2291BaseType_t xTaskPriorityDisinherit(TaskHandle_t
const pxMutexHolder) PRIVILEGED_FUNCTION;
2301void vTaskPriorityDisinheritAfterTimeout(TaskHandle_t
const pxMutexHolder,
2302 UBaseType_t uxHighestPriorityWaitingTask) PRIVILEGED_FUNCTION;
2307UBaseType_t uxTaskGetTaskNumber(TaskHandle_t xTask) PRIVILEGED_FUNCTION;
2313void vTaskSetTaskNumber(TaskHandle_t xTask,
const UBaseType_t uxHandle) PRIVILEGED_FUNCTION;
2323void vTaskStepTick(
const TickType_t xTicksToJump) PRIVILEGED_FUNCTION;
2339eSleepModeStatus eTaskConfirmSleepModeStatus(
void) PRIVILEGED_FUNCTION;
2345void *pvTaskIncrementMutexHeldCount(
void) PRIVILEGED_FUNCTION;
2351void vTaskInternalSetTimeOutState(
TimeOut_t *
const pxTimeOut) PRIVILEGED_FUNCTION;
Definition FreeRTOS.h:982