Data Structures | |
struct | xMEMORY_REGION |
struct | xTASK_PARAMTERS |
struct | xTIME_OUT |
Macros | |
#define | taskDISABLE_INTERRUPTS() portDISABLE_INTERRUPTS() |
#define | taskENABLE_INTERRUPTS() portENABLE_INTERRUPTS() |
#define | taskENTER_CRITICAL() portENTER_CRITICAL() |
#define | taskEXIT_CRITICAL() portEXIT_CRITICAL() |
#define | taskSCHEDULER_NOT_STARTED 0 |
#define | taskSCHEDULER_RUNNING 1 |
#define | taskSCHEDULER_SUSPENDED 2 |
#define | taskYIELD() portYIELD() |
#define | tskIDLE_PRIORITY ( ( unsigned portBASE_TYPE ) 0U ) |
#define | tskKERNEL_VERSION_NUMBER "V7.3.0" |
#define | xTaskCreate(pvTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pxCreatedTask) xTaskGenericCreate( ( pvTaskCode ), ( pcName ), ( usStackDepth ), ( pvParameters ), ( uxPriority ), ( pxCreatedTask ), ( NULL ), ( NULL ) ) |
#define | xTaskCreateRestricted(x, pxCreatedTask) xTaskGenericCreate( ((x)->pvTaskCode), ((x)->pcName), ((x)->usStackDepth), ((x)->pvParameters), ((x)->uxPriority), (pxCreatedTask), ((x)->puxStackBuffer), ((x)->xRegions) ) |
Typedefs | |
typedef struct xMEMORY_REGION | xMemoryRegion |
typedef void * | xTaskHandle |
typedef struct xTASK_PARAMTERS | xTaskParameters |
typedef struct xTIME_OUT | xTimeOutType |
Enumerations | |
enum | eTaskState { eRunning = 0, eReady, eBlocked, eSuspended, eDeleted } |
#define taskDISABLE_INTERRUPTS | ( | ) | portDISABLE_INTERRUPTS() |
#define taskENABLE_INTERRUPTS | ( | ) | portENABLE_INTERRUPTS() |
#define taskENTER_CRITICAL | ( | ) | portENTER_CRITICAL() |
Referenced by FreeRTOS_CLIRegisterCommand(), prvCheckForValidListAndQueue(), prvCheckTasksWaitingTermination(), prvInitialiseTaskLists(), prvIsQueueEmpty(), prvIsQueueFull(), prvUnlockQueue(), uxQueueMessagesWaiting(), uxTaskPriorityGet(), vTaskDelete(), vTaskPrioritySet(), vTaskResume(), vTaskSuspend(), xQueueGenericReceive(), xQueueGenericReset(), xQueueGenericSend(), xTaskCheckForTimeOut(), xTaskGetTickCount(), xTaskResumeAll(), and xTimerIsTimerActive().
#define taskEXIT_CRITICAL | ( | ) | portEXIT_CRITICAL() |
Referenced by FreeRTOS_CLIRegisterCommand(), prvCheckForValidListAndQueue(), prvCheckTasksWaitingTermination(), prvInitialiseTaskLists(), prvIsQueueEmpty(), prvIsQueueFull(), prvUnlockQueue(), uxQueueMessagesWaiting(), uxTaskPriorityGet(), vTaskDelete(), vTaskPrioritySet(), vTaskResume(), vTaskSuspend(), xQueueGenericReceive(), xQueueGenericReset(), xQueueGenericSend(), xTaskCheckForTimeOut(), xTaskGetTickCount(), xTaskResumeAll(), and xTimerIsTimerActive().
#define taskSCHEDULER_NOT_STARTED 0 |
Referenced by xTaskGetSchedulerState().
#define taskSCHEDULER_RUNNING 1 |
Referenced by xTaskGetSchedulerState(), and xTimerGenericCommand().
#define taskSCHEDULER_SUSPENDED 2 |
Referenced by xTaskGetSchedulerState().
#define taskYIELD | ( | ) | portYIELD() |
Referenced by portTASK_FUNCTION().
#define tskIDLE_PRIORITY ( ( unsigned portBASE_TYPE ) 0U ) |
Referenced by vTaskList(), and vTaskStartScheduler().
#define tskKERNEL_VERSION_NUMBER "V7.3.0" |
#define xTaskCreate | ( | pvTaskCode, | |
pcName, | |||
usStackDepth, | |||
pvParameters, | |||
uxPriority, | |||
pxCreatedTask | |||
) | xTaskGenericCreate( ( pvTaskCode ), ( pcName ), ( usStackDepth ), ( pvParameters ), ( uxPriority ), ( pxCreatedTask ), ( NULL ), ( NULL ) ) |
Referenced by main(), os_hook_init(), prvCheckForValidListAndQueue(), sys_thread_new(), and vTaskStartScheduler().
#define xTaskCreateRestricted | ( | x, | |
pxCreatedTask | |||
) | xTaskGenericCreate( ((x)->pvTaskCode), ((x)->pcName), ((x)->usStackDepth), ((x)->pvParameters), ((x)->uxPriority), (pxCreatedTask), ((x)->puxStackBuffer), ((x)->xRegions) ) |
typedef struct xMEMORY_REGION xMemoryRegion |
typedef void* xTaskHandle |
typedef struct xTASK_PARAMTERS xTaskParameters |
typedef struct xTIME_OUT xTimeOutType |
enum eTaskState |
eTaskState eTaskStateGet | ( | xTaskHandle | pxTask | ) |
task.
h
eTaskState eTaskStateGet( xTaskHandle pxTask );
INCLUDE_eTaskStateGet must be defined as 1 for this function to be available. See the configuration section for more information.
Obtain the state of any task. States are encoded by the eTaskState enumerated type.
pxTask | Handle of the task to be queried. |
signed char* pcTaskGetTaskName | ( | xTaskHandle | xTaskToQuery | ) |
unsigned portBASE_TYPE uxTaskGetNumberOfTasks | ( | void | ) |
References uxCurrentNumberOfTasks.
unsigned portBASE_TYPE uxTaskGetStackHighWaterMark | ( | xTaskHandle | xTask | ) |
task.h
unsigned portBASE_TYPE uxTaskGetStackHighWaterMark( xTaskHandle xTask );
INCLUDE_uxTaskGetStackHighWaterMark must be set to 1 in FreeRTOSConfig.h for this function to be available.
Returns the high water mark of the stack associated with xTask. That is, the minimum free stack space there has been (in words, so on a 32 bit machine a value of 1 means 4 bytes) since the task started. The smaller the returned number the closer the task has come to overflowing its stack.
xTask | Handle of the task associated with the stack to be checked. Set xTask to NULL to check the stack of the calling task. |
unsigned portBASE_TYPE uxTaskGetTaskNumber | ( | xTaskHandle | xTask | ) |
References NULL, and tskTaskControlBlock::uxTaskNumber.
unsigned portBASE_TYPE uxTaskPriorityGet | ( | xTaskHandle | pxTask | ) |
References prvGetTCBFromHandle, taskENTER_CRITICAL, taskEXIT_CRITICAL, and tskTaskControlBlock::uxPriority.
void vTaskAllocateMPURegions | ( | xTaskHandle | xTask, |
const xMemoryRegion *const | pxRegions | ||
) |
void vTaskDelay | ( | portTickType | xTicksToDelay | ) |
References pdFALSE, portRESET_READY_PRIORITY, portYIELD_WITHIN_API, prvAddCurrentTaskToDelayedList(), pxCurrentTCB, traceTASK_DELAY, uxListRemove(), tskTaskControlBlock::uxPriority, uxTopReadyPriority, vTaskSuspendAll(), tskTaskControlBlock::xGenericListItem, xTaskResumeAll(), and xTickCount.
Referenced by ap_task(), http_request(), sta_task(), and wilc_netif_tx_from_queue().
void vTaskDelayUntil | ( | portTickType *const | pxPreviousWakeTime, |
portTickType | xTimeIncrement | ||
) |
References configASSERT, pdFALSE, pdTRUE, portRESET_READY_PRIORITY, portYIELD_WITHIN_API, prvAddCurrentTaskToDelayedList(), pxCurrentTCB, traceTASK_DELAY_UNTIL, uxListRemove(), tskTaskControlBlock::uxPriority, uxTopReadyPriority, vTaskSuspendAll(), tskTaskControlBlock::xGenericListItem, xTaskResumeAll(), and xTickCount.
void vTaskDelete | ( | xTaskHandle | pxTaskToDelete | ) |
References NULL, pdFALSE, portYIELD_WITHIN_API, prvGetTCBFromHandle, xLIST_ITEM::pvContainer, pxCurrentTCB, taskENTER_CRITICAL, taskEXIT_CRITICAL, taskRESET_READY_PRIORITY, traceTASK_DELETE, uxListRemove(), tskTaskControlBlock::uxPriority, uxTaskNumber, uxTasksDeleted, vListInsertEnd(), tskTaskControlBlock::xEventListItem, tskTaskControlBlock::xGenericListItem, xSchedulerRunning, and xTasksWaitingTermination.
Referenced by ap_task().
References pdFALSE, vPortEndScheduler(), and xSchedulerRunning.
void vTaskGetRunTimeStats | ( | signed char * | pcWriteBuffer | ) |
References configASSERT, listGET_LIST_ITEM_VALUE, listGET_OWNER_OF_HEAD_ENTRY, listLIST_IS_EMPTY, pdFALSE, prvCheckDelayedTasks, pxDelayedTaskList, pxOverflowDelayedTaskList, traceTASK_INCREMENT_TICK, uxMissedTicks, uxSchedulerSuspended, vApplicationTickHook(), tskTaskControlBlock::xGenericListItem, xNextTaskUnblockTime, xNumOfOverflows, and xTickCount.
Referenced by xTaskResumeAll().
void vTaskList | ( | signed char * | pcWriteBuffer | ) |
References listLIST_IS_EMPTY, pdFALSE, prvListTaskWithinSingleList(), pxDelayedTaskList, pxOverflowDelayedTaskList, pxReadyTasksLists, tskBLOCKED_CHAR, tskDELETED_CHAR, tskIDLE_PRIORITY, tskREADY_CHAR, tskSUSPENDED_CHAR, uxTopUsedPriority, vTaskSuspendAll(), xSuspendedTaskList, xTaskResumeAll(), and xTasksWaitingTermination.
Referenced by http_request().
References pdTRUE, and xMissedYield.
Referenced by prvUnlockQueue().
References configASSERT, portRESET_READY_PRIORITY, prvAddCurrentTaskToDelayedList(), pxCurrentTCB, uxListRemove(), tskTaskControlBlock::uxPriority, uxTopReadyPriority, vListInsert(), vListInsertEnd(), tskTaskControlBlock::xEventListItem, tskTaskControlBlock::xGenericListItem, xSuspendedTaskList, and xTickCount.
Referenced by xQueueGenericReceive(), and xQueueGenericSend().
References configASSERT, portRESET_READY_PRIORITY, prvAddCurrentTaskToDelayedList(), pxCurrentTCB, traceTASK_DELAY_UNTIL, uxListRemove(), tskTaskControlBlock::uxPriority, uxTopReadyPriority, vListInsertEnd(), tskTaskControlBlock::xEventListItem, tskTaskControlBlock::xGenericListItem, and xTickCount.
Referenced by vQueueWaitForMessageRestricted().
void vTaskPriorityDisinherit | ( | xTaskHandle *const | pxMutexHolder | ) |
References configMAX_PRIORITIES, listSET_LIST_ITEM_VALUE, NULL, prvAddTaskToReadyQueue, taskRESET_READY_PRIORITY, traceTASK_PRIORITY_DISINHERIT, tskTaskControlBlock::uxBasePriority, uxListRemove(), tskTaskControlBlock::uxPriority, tskTaskControlBlock::xEventListItem, and tskTaskControlBlock::xGenericListItem.
Referenced by prvCopyDataToQueue().
void vTaskPriorityInherit | ( | xTaskHandle *const | pxMutexHolder | ) |
References configMAX_PRIORITIES, listIS_CONTAINED_WITHIN, listSET_LIST_ITEM_VALUE, NULL, pdFALSE, prvAddTaskToReadyQueue, pxCurrentTCB, pxReadyTasksLists, taskRESET_READY_PRIORITY, traceTASK_PRIORITY_INHERIT, uxListRemove(), tskTaskControlBlock::uxPriority, tskTaskControlBlock::xEventListItem, and tskTaskControlBlock::xGenericListItem.
Referenced by xQueueGenericReceive().
void vTaskPrioritySet | ( | xTaskHandle | pxTask, |
unsigned portBASE_TYPE | uxNewPriority | ||
) |
References configASSERT, configMAX_PRIORITIES, listIS_CONTAINED_WITHIN, listSET_LIST_ITEM_VALUE, NULL, pdFALSE, pdTRUE, portYIELD_WITHIN_API, prvAddTaskToReadyQueue, prvGetTCBFromHandle, pxCurrentTCB, pxReadyTasksLists, taskENTER_CRITICAL, taskEXIT_CRITICAL, taskRESET_READY_PRIORITY, traceTASK_PRIORITY_SET, tskTaskControlBlock::uxBasePriority, uxListRemove(), tskTaskControlBlock::uxPriority, void, tskTaskControlBlock::xEventListItem, and tskTaskControlBlock::xGenericListItem.
void vTaskResume | ( | xTaskHandle | pxTaskToResume | ) |
void vTaskSetTaskNumber | ( | xTaskHandle | xTask, |
unsigned portBASE_TYPE | uxHandle | ||
) |
References NULL, and tskTaskControlBlock::uxTaskNumber.
void vTaskSetTimeOutState | ( | xTimeOutType *const | pxTimeOut | ) |
References configASSERT, xNumOfOverflows, xTIME_OUT::xOverflowCount, xTickCount, and xTIME_OUT::xTimeOnEntering.
Referenced by xQueueGenericReceive(), xQueueGenericSend(), and xTaskCheckForTimeOut().
References configASSERT, NULL, pdFALSE, pdPASS, pdTRUE, portCONFIGURE_TIMER_FOR_RUN_TIME_STATS, portPRIVILEGE_BIT, tskIDLE_PRIORITY, tskIDLE_STACK_SIZE, xPortStartScheduler(), xSchedulerRunning, xTaskCreate, xTickCount, and xTimerCreateTimerTask().
Referenced by main().
void vTaskStepTick | ( | portTickType | xTicksToJump | ) |
void vTaskSuspend | ( | xTaskHandle | pxTaskToSuspend | ) |
References listCURRENT_LIST_LENGTH, NULL, pdFALSE, portYIELD_WITHIN_API, prvGetTCBFromHandle, xLIST_ITEM::pvContainer, pxCurrentTCB, taskENTER_CRITICAL, taskEXIT_CRITICAL, taskRESET_READY_PRIORITY, traceTASK_SUSPEND, uxCurrentNumberOfTasks, uxListRemove(), tskTaskControlBlock::uxPriority, vListInsertEnd(), vTaskSwitchContext(), tskTaskControlBlock::xEventListItem, tskTaskControlBlock::xGenericListItem, xSchedulerRunning, and xSuspendedTaskList.
portBASE_TYPE xTaskCallApplicationTaskHook | ( | xTaskHandle | xTask, |
void * | pvParameter | ||
) |
task.h
portBASE_TYPE xTaskCallApplicationTaskHook( xTaskHandle xTask, pdTASK_HOOK_CODE pxHookFunction );
Calls the hook function associated with xTask. Passing xTask as NULL has the effect of calling the Running tasks (the calling task) hook function.
pvParameter is passed to the hook function for the task to interpret as it wants.
portBASE_TYPE xTaskCheckForTimeOut | ( | xTimeOutType *const | pxTimeOut, |
portTickType *const | pxTicksToWait | ||
) |
References configASSERT, pdFALSE, pdTRUE, taskENTER_CRITICAL, taskEXIT_CRITICAL, vTaskSetTimeOutState(), xNumOfOverflows, xTIME_OUT::xOverflowCount, xTickCount, and xTIME_OUT::xTimeOnEntering.
Referenced by xQueueGenericReceive(), and xQueueGenericSend().
signed portBASE_TYPE xTaskGenericCreate | ( | pdTASK_CODE | pxTaskCode, |
const signed char *const | pcName, | ||
unsigned short | usStackDepth, | ||
void * | pvParameters, | ||
unsigned portBASE_TYPE | uxPriority, | ||
xTaskHandle * | pxCreatedTask, | ||
portSTACK_TYPE * | puxStackBuffer, | ||
const xMemoryRegion *const | xRegions | ||
) |
xTaskHandle xTaskGetCurrentTaskHandle | ( | void | ) |
xTaskHandle xTaskGetIdleTaskHandle | ( | void | ) |
xTaskGetIdleTaskHandle() is only available if INCLUDE_xTaskGetIdleTaskHandle is set to 1 in FreeRTOSConfig.h.
Simply returns the handle of the idle task. It is not valid to call xTaskGetIdleTaskHandle() before the scheduler has been started.
portBASE_TYPE xTaskGetSchedulerState | ( | void | ) |
References pdFALSE, taskSCHEDULER_NOT_STARTED, taskSCHEDULER_RUNNING, taskSCHEDULER_SUSPENDED, uxSchedulerSuspended, and xSchedulerRunning.
Referenced by xTimerGenericCommand().
portTickType xTaskGetTickCount | ( | void | ) |
References taskENTER_CRITICAL, taskEXIT_CRITICAL, and xTickCount.
Referenced by prvSampleTimeNow(), sys_arch_mbox_fetch(), sys_arch_sem_wait(), and sys_now().
portTickType xTaskGetTickCountFromISR | ( | void | ) |
References portCLEAR_INTERRUPT_MASK_FROM_ISR, portSET_INTERRUPT_MASK_FROM_ISR, and xTickCount.
signed portBASE_TYPE xTaskIsTaskSuspended | ( | xTaskHandle | xTask | ) |
task.
h
signed portBASE_TYPE xTaskIsTaskSuspended( xTaskHandle xTask );
Utility task that simply returns pdTRUE if the task referenced by xTask is currently in the Suspended state, or pdFALSE if the task referenced by xTask is in any other state.
References configASSERT, listIS_CONTAINED_WITHIN, NULL, pdFALSE, pdTRUE, tskTaskControlBlock::xEventListItem, tskTaskControlBlock::xGenericListItem, xPendingReadyList, and xSuspendedTaskList.
Referenced by vTaskResume(), and xTaskResumeFromISR().
signed portBASE_TYPE xTaskRemoveFromEventList | ( | const xList *const | pxEventList | ) |
References configASSERT, listGET_OWNER_OF_HEAD_ENTRY, pdFALSE, pdTRUE, prvAddTaskToReadyQueue, pxCurrentTCB, uxListRemove(), tskTaskControlBlock::uxPriority, uxSchedulerSuspended, vListInsertEnd(), tskTaskControlBlock::xEventListItem, tskTaskControlBlock::xGenericListItem, and xPendingReadyList.
Referenced by prvUnlockQueue(), xQueueGenericReceive(), xQueueGenericReset(), xQueueGenericSend(), xQueueGenericSendFromISR(), and xQueueReceiveFromISR().
signed portBASE_TYPE xTaskResumeAll | ( | void | ) |
References configASSERT, listGET_OWNER_OF_HEAD_ENTRY, listLIST_IS_EMPTY, pdFALSE, pdTRUE, portYIELD_WITHIN_API, prvAddTaskToReadyQueue, pxCurrentTCB, taskENTER_CRITICAL, taskEXIT_CRITICAL, uxCurrentNumberOfTasks, uxListRemove(), uxMissedTicks, tskTaskControlBlock::uxPriority, uxSchedulerSuspended, vTaskIncrementTick(), tskTaskControlBlock::xEventListItem, tskTaskControlBlock::xGenericListItem, xMissedYield, and xPendingReadyList.
Referenced by portTASK_FUNCTION(), prvCheckTasksWaitingTermination(), prvProcessTimerOrBlockTask(), pvPortMalloc(), vPortFree(), vTaskDelay(), vTaskDelayUntil(), vTaskList(), xQueueGenericReceive(), and xQueueGenericSend().
portBASE_TYPE xTaskResumeFromISR | ( | xTaskHandle | pxTaskToResume | ) |
References configASSERT, pdFALSE, pdTRUE, portCLEAR_INTERRUPT_MASK_FROM_ISR, portSET_INTERRUPT_MASK_FROM_ISR, prvAddTaskToReadyQueue, pxCurrentTCB, traceTASK_RESUME_FROM_ISR, uxListRemove(), tskTaskControlBlock::uxPriority, uxSchedulerSuspended, vListInsertEnd(), tskTaskControlBlock::xEventListItem, tskTaskControlBlock::xGenericListItem, xPendingReadyList, and xTaskIsTaskSuspended().