74 #ifndef INC_FREERTOS_H 75 #error "include FreeRTOS.h must appear in source files before include task.h" 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 103 typedef void * TaskHandle_t;
109 typedef BaseType_t (*TaskHookFunction_t)(
void * );
127 eSetValueWithOverwrite,
128 eSetValueWithoutOverwrite
136 BaseType_t xOverflowCount;
137 TickType_t xTimeOnEntering;
146 uint32_t ulLengthInBytes;
147 uint32_t ulParameters;
155 TaskFunction_t pvTaskCode;
156 const char *
const pcName;
157 uint16_t usStackDepth;
159 UBaseType_t uxPriority;
160 StackType_t *puxStackBuffer;
168 TaskHandle_t xHandle;
169 const char *pcTaskName;
170 UBaseType_t xTaskNumber;
171 eTaskState eCurrentState;
172 UBaseType_t uxCurrentPriority;
173 UBaseType_t uxBasePriority;
174 uint32_t ulRunTimeCounter;
175 uint16_t usStackHighWaterMark;
183 eNoTasksWaitingTimeout
192 #define tskIDLE_PRIORITY ( ( UBaseType_t ) 0U ) 202 #define taskYIELD() portYIELD() 216 #define taskENTER_CRITICAL() portENTER_CRITICAL() 217 #define taskENTER_CRITICAL_FROM_ISR() portSET_INTERRUPT_MASK_FROM_ISR() 231 #define taskEXIT_CRITICAL() portEXIT_CRITICAL() 232 #define taskEXIT_CRITICAL_FROM_ISR( x ) portCLEAR_INTERRUPT_MASK_FROM_ISR( x ) 241 #define taskDISABLE_INTERRUPTS() portDISABLE_INTERRUPTS() 251 #define taskENABLE_INTERRUPTS() portENABLE_INTERRUPTS() 256 #define taskSCHEDULER_SUSPENDED ( ( BaseType_t ) 0 ) 257 #define taskSCHEDULER_NOT_STARTED ( ( BaseType_t ) 1 ) 258 #define taskSCHEDULER_RUNNING ( ( BaseType_t ) 2 ) 345 #define xTaskCreate( pvTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pxCreatedTask ) xTaskGenericCreate( ( pvTaskCode ), ( pcName ), ( usStackDepth ), ( pvParameters ), ( uxPriority ), ( pxCreatedTask ), ( NULL ), ( NULL ) ) 414 #define xTaskCreateRestricted( x, pxCreatedTask ) xTaskGenericCreate( ((x)->pvTaskCode), ((x)->pcName), ((x)->usStackDepth), ((x)->pvParameters), ((x)->uxPriority), (pxCreatedTask), ((x)->puxStackBuffer), ((x)->xRegions) ) 462 void vTaskAllocateMPURegions( TaskHandle_t xTask,
const MemoryRegion_t *
const pxRegions ) PRIVILEGED_FUNCTION;
503 void vTaskDelete( TaskHandle_t xTaskToDelete ) PRIVILEGED_FUNCTION;
555 void vTaskDelay(
const TickType_t xTicksToDelay ) PRIVILEGED_FUNCTION;
614 void vTaskDelayUntil( TickType_t *
const pxPreviousWakeTime,
const TickType_t xTimeIncrement ) PRIVILEGED_FUNCTION;
661 UBaseType_t uxTaskPriorityGet( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
669 UBaseType_t uxTaskPriorityGetFromISR( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
687 eTaskState eTaskGetState( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
729 void vTaskPrioritySet( TaskHandle_t xTask, UBaseType_t uxNewPriority ) PRIVILEGED_FUNCTION;
780 void vTaskSuspend( TaskHandle_t xTaskToSuspend ) PRIVILEGED_FUNCTION;
829 void vTaskResume( TaskHandle_t xTaskToResume ) PRIVILEGED_FUNCTION;
858 BaseType_t xTaskResumeFromISR( TaskHandle_t xTaskToResume ) PRIVILEGED_FUNCTION;
891 void vTaskStartScheduler(
void ) PRIVILEGED_FUNCTION;
947 void vTaskEndScheduler(
void ) PRIVILEGED_FUNCTION;
998 void vTaskSuspendAll(
void ) PRIVILEGED_FUNCTION;
1052 BaseType_t xTaskResumeAll(
void ) PRIVILEGED_FUNCTION;
1067 TickType_t xTaskGetTickCount(
void ) PRIVILEGED_FUNCTION;
1083 TickType_t xTaskGetTickCountFromISR(
void ) PRIVILEGED_FUNCTION;
1097 UBaseType_t uxTaskGetNumberOfTasks(
void ) PRIVILEGED_FUNCTION;
1111 char *pcTaskGetTaskName( TaskHandle_t xTaskToQuery ) PRIVILEGED_FUNCTION;
1132 UBaseType_t uxTaskGetStackHighWaterMark( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
1140 #ifdef configUSE_APPLICATION_TASK_TAG 1141 #if configUSE_APPLICATION_TASK_TAG == 1 1150 void vTaskSetApplicationTaskTag( TaskHandle_t xTask, TaskHookFunction_t pxHookFunction ) PRIVILEGED_FUNCTION;
1158 TaskHookFunction_t xTaskGetApplicationTaskTag( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
1162 #if( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 ) 1169 void vTaskSetThreadLocalStoragePointer( TaskHandle_t xTaskToSet, BaseType_t xIndex,
void *pvValue ) PRIVILEGED_FUNCTION;
1170 void *pvTaskGetThreadLocalStoragePointer( TaskHandle_t xTaskToQuery, BaseType_t xIndex ) PRIVILEGED_FUNCTION;
1185 BaseType_t xTaskCallApplicationTaskHook( TaskHandle_t xTask,
void *pvParameter ) PRIVILEGED_FUNCTION;
1194 TaskHandle_t xTaskGetIdleTaskHandle(
void ) PRIVILEGED_FUNCTION;
1293 UBaseType_t uxTaskGetSystemState(
TaskStatus_t *
const pxTaskStatusArray,
const UBaseType_t uxArraySize, uint32_t *
const pulTotalRunTime ) PRIVILEGED_FUNCTION;
1340 void vTaskList(
char * pcWriteBuffer ) PRIVILEGED_FUNCTION;
1394 void vTaskGetRunTimeStats(
char *pcWriteBuffer ) PRIVILEGED_FUNCTION;
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 ) ) 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 ) ) 1643 BaseType_t xTaskNotifyWait( uint32_t ulBitsToClearOnEntry, uint32_t ulBitsToClearOnExit, uint32_t *pulNotificationValue, TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
1689 #define xTaskNotifyGive( xTaskToNotify ) xTaskGenericNotify( ( xTaskToNotify ), ( 0 ), eIncrement, NULL ) 1744 void vTaskNotifyGiveFromISR( TaskHandle_t xTaskToNotify, BaseType_t *pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
1813 uint32_t ulTaskNotifyTake( BaseType_t xClearCountOnExit, TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
1829 BaseType_t xTaskNotifyStateClear( TaskHandle_t xTask );
1850 BaseType_t xTaskIncrementTick(
void ) PRIVILEGED_FUNCTION;
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;
1897 void vTaskPlaceOnEventListRestricted(
List_t *
const pxEventList,
const TickType_t xTicksToWait,
const BaseType_t xWaitIndefinitely ) PRIVILEGED_FUNCTION;
1923 BaseType_t xTaskRemoveFromEventList(
const List_t *
const pxEventList ) PRIVILEGED_FUNCTION;
1924 BaseType_t xTaskRemoveFromUnorderedEventList(
ListItem_t * pxEventListItem,
const TickType_t xItemValue ) PRIVILEGED_FUNCTION;
1934 void vTaskSwitchContext(
void ) PRIVILEGED_FUNCTION;
1940 TickType_t uxTaskResetEventItemValue(
void ) PRIVILEGED_FUNCTION;
1945 TaskHandle_t xTaskGetCurrentTaskHandle(
void ) PRIVILEGED_FUNCTION;
1950 void vTaskSetTimeOutState(
TimeOut_t *
const pxTimeOut ) PRIVILEGED_FUNCTION;
1956 BaseType_t xTaskCheckForTimeOut(
TimeOut_t *
const pxTimeOut, TickType_t *
const pxTicksToWait ) PRIVILEGED_FUNCTION;
1962 void vTaskMissedYield(
void ) PRIVILEGED_FUNCTION;
1968 BaseType_t xTaskGetSchedulerState(
void ) PRIVILEGED_FUNCTION;
1974 void vTaskPriorityInherit( TaskHandle_t
const pxMutexHolder ) PRIVILEGED_FUNCTION;
1980 BaseType_t xTaskPriorityDisinherit( TaskHandle_t
const pxMutexHolder ) PRIVILEGED_FUNCTION;
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;
1991 UBaseType_t uxTaskGetTaskNumber( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
1997 void vTaskSetTaskNumber( TaskHandle_t xTask,
const UBaseType_t uxHandle ) PRIVILEGED_FUNCTION;
2007 void vTaskStepTick(
const TickType_t xTicksToJump ) PRIVILEGED_FUNCTION;
2023 eSleepModeStatus eTaskConfirmSleepModeStatus(
void ) PRIVILEGED_FUNCTION;
2029 void *pvTaskIncrementMutexHeldCount(
void ) PRIVILEGED_FUNCTION;