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() |
Referenced by vApplicationMallocFailedHook(), and vApplicationStackOverflowHook().
#define taskENABLE_INTERRUPTS | ( | ) | portENABLE_INTERRUPTS() |
#define taskENTER_CRITICAL | ( | ) | portENTER_CRITICAL() |
Referenced by eTaskStateGet(), FreeRTOS_CLIRegisterCommand(), prvCheckForValidListAndQueue(), prvCheckTasksWaitingTermination(), prvInitialiseTaskLists(), prvIsQueueEmpty(), prvIsQueueFull(), prvUnlockQueue(), uxQueueMessagesWaiting(), uxTaskPriorityGet(), vTaskDelete(), vTaskPrioritySet(), vTaskResume(), vTaskSetApplicationTaskTag(), vTaskSuspend(), xQueueGenericReceive(), xQueueGenericReset(), xQueueGenericSend(), xTaskCheckForTimeOut(), xTaskGetApplicationTaskTag(), xTaskGetTickCount(), xTaskResumeAll(), and xTimerIsTimerActive().
#define taskEXIT_CRITICAL | ( | ) | portEXIT_CRITICAL() |
Referenced by eTaskStateGet(), FreeRTOS_CLIRegisterCommand(), prvCheckForValidListAndQueue(), prvCheckTasksWaitingTermination(), prvInitialiseTaskLists(), prvIsQueueEmpty(), prvIsQueueFull(), prvUnlockQueue(), uxQueueMessagesWaiting(), uxTaskPriorityGet(), vTaskDelete(), vTaskPrioritySet(), vTaskResume(), vTaskSetApplicationTaskTag(), vTaskSuspend(), xQueueGenericReceive(), xQueueGenericReset(), xQueueGenericSend(), xTaskCheckForTimeOut(), xTaskGetApplicationTaskTag(), 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 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 prvCheckForValidListAndQueue(), vPhyEmbeddedAppTask(), 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. |
References eBlocked, eDeleted, eReady, eRunning, eSuspended, listLIST_ITEM_CONTAINER, pxCurrentTCB, pxDelayedTaskList, pxOverflowDelayedTaskList, taskENTER_CRITICAL, taskEXIT_CRITICAL, tskTaskControlBlock::xGenericListItem, xSuspendedTaskList, and xTasksWaitingTermination.
signed char* pcTaskGetTaskName | ( | xTaskHandle | xTaskToQuery | ) |
unsigned portBASE_TYPE uxTaskGetNumberOfTasks | ( | void | ) |
References uxCurrentNumberOfTasks.
unsigned portBASE_TYPE uxTaskGetStackHighWaterMark | ( | xTaskHandle | xTask | ) |
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. |
References prvGetTCBFromHandle, tskTaskControlBlock::pxStack, and usTaskCheckFreeStackSpace().
unsigned portBASE_TYPE uxTaskGetTaskNumber | ( | xTaskHandle | xTask | ) |
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 | ) |
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.
Referenced by prvAppPhyTask(), prvGetRxTask(), and prvGetTxResultTask().
void vTaskDelete | ( | xTaskHandle | pxTaskToDelete | ) |
References 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.
void vTaskEndScheduler | ( | void | ) |
References pdFALSE, vPortEndScheduler(), and xSchedulerRunning.
void vTaskGetRunTimeStats | ( | signed char * | pcWriteBuffer | ) |
void vTaskIncrementTick | ( | void | ) |
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 | ) |
void vTaskMissedYield | ( | void | ) |
References pdTRUE, and xMissedYield.
Referenced by prvUnlockQueue().
void vTaskPlaceOnEventList | ( | const xList *const | pxEventList, |
portTickType | xTicksToWait | ||
) |
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().
void vTaskPlaceOnEventListRestricted | ( | const xList *const | pxEventList, |
portTickType | xTicksToWait | ||
) |
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 | ) |
Referenced by prvCopyDataToQueue().
void vTaskPriorityInherit | ( | xTaskHandle *const | pxMutexHolder | ) |
Referenced by xQueueGenericReceive().
void vTaskPrioritySet | ( | xTaskHandle | pxTask, |
unsigned portBASE_TYPE | uxNewPriority | ||
) |
References configASSERT, configMAX_PRIORITIES, listIS_CONTAINED_WITHIN, listSET_LIST_ITEM_VALUE, pdFALSE, pdTRUE, portYIELD_WITHIN_API, prvAddTaskToReadyQueue, prvGetTCBFromHandle, pxCurrentTCB, pxReadyTasksLists, taskENTER_CRITICAL, taskEXIT_CRITICAL, taskRESET_READY_PRIORITY, traceTASK_PRIORITY_SET, uxListRemove(), tskTaskControlBlock::uxPriority, tskTaskControlBlock::xEventListItem, and tskTaskControlBlock::xGenericListItem.
void vTaskResume | ( | xTaskHandle | pxTaskToResume | ) |
void vTaskSetTaskNumber | ( | xTaskHandle | xTask, |
unsigned portBASE_TYPE | uxHandle | ||
) |
void vTaskSetTimeOutState | ( | xTimeOutType *const | pxTimeOut | ) |
References configASSERT, xNumOfOverflows, xTIME_OUT::xOverflowCount, xTickCount, and xTIME_OUT::xTimeOnEntering.
Referenced by xQueueGenericReceive(), xQueueGenericSend(), and xTaskCheckForTimeOut().
void vTaskStartScheduler | ( | void | ) |
References configASSERT, pdFALSE, pdPASS, pdTRUE, portCONFIGURE_TIMER_FOR_RUN_TIME_STATS, portPRIVILEGE_BIT, tskIDLE_PRIORITY, tskIDLE_STACK_SIZE, xPortStartScheduler(), xSchedulerRunning, xTaskCreate, xTickCount, and xTimerCreateTimerTask().
Referenced by execute_tx_test().
void vTaskStepTick | ( | portTickType | xTicksToJump | ) |
void vTaskSuspend | ( | xTaskHandle | pxTaskToSuspend | ) |
References listCURRENT_LIST_LENGTH, 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.
void vTaskSuspendAll | ( | void | ) |
void vTaskSwitchContext | ( | void | ) |
portBASE_TYPE xTaskCallApplicationTaskHook | ( | xTaskHandle | xTask, |
void * | pvParameter | ||
) |
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.
References pdFAIL, pxCurrentTCB, and tskTaskControlBlock::pxTaskTag.
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 | ) |
Referenced by xQueueGenericReceive().
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 prvAppPhyTask(), prvGetRxTask(), prvGetTxResultTask(), and prvSampleTimeNow().
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, 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(), 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().