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.0.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 |
#define taskDISABLE_INTERRUPTS | ( | ) | portDISABLE_INTERRUPTS() |
#define taskENABLE_INTERRUPTS | ( | ) | portENABLE_INTERRUPTS() |
#define taskENTER_CRITICAL | ( | ) | portENTER_CRITICAL() |
Referenced by prvCheckTasksWaitingTermination(), prvInitialiseTaskLists(), prvIsQueueEmpty(), prvIsQueueFull(), prvUnlockQueue(), usb_general_interrupt_non_naked(), uxQueueMessagesWaiting(), uxTaskPriorityGet(), vTaskDelete(), vTaskPrioritySet(), vTaskResume(), vTaskSuspend(), xQueueGenericReceive(), xQueueGenericSend(), xTaskCheckForTimeOut(), xTaskGetTickCount(), and xTaskResumeAll().
#define taskEXIT_CRITICAL | ( | ) | portEXIT_CRITICAL() |
Referenced by prvCheckTasksWaitingTermination(), prvInitialiseTaskLists(), prvIsQueueEmpty(), prvIsQueueFull(), prvUnlockQueue(), usb_general_interrupt_non_naked(), uxQueueMessagesWaiting(), uxTaskPriorityGet(), vTaskDelete(), vTaskPrioritySet(), vTaskResume(), vTaskSuspend(), xQueueGenericReceive(), xQueueGenericSend(), xTaskCheckForTimeOut(), xTaskGetTickCount(), and xTaskResumeAll().
#define taskSCHEDULER_NOT_STARTED 0 |
#define taskSCHEDULER_RUNNING 1 |
#define taskSCHEDULER_SUSPENDED 2 |
#define taskYIELD | ( | ) | portYIELD() |
Referenced by portTASK_FUNCTION().
#define tskIDLE_PRIORITY ( ( unsigned portBASE_TYPE ) 0U ) |
Referenced by vTaskStartScheduler().
#define tskKERNEL_VERSION_NUMBER "V7.0.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) ) |
typedef struct xMEMORY_REGION xMemoryRegion |
typedef void* xTaskHandle |
typedef struct xTASK_PARAMTERS xTaskParameters |
typedef struct xTIME_OUT xTimeOutType |
unsigned long ulTaskEndTrace | ( | void | ) |
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. |
unsigned portBASE_TYPE uxTaskPriorityGet | ( | xTaskHandle | pxTask | ) |
References prvGetTCBFromHandle, taskENTER_CRITICAL, taskEXIT_CRITICAL, and tskTaskControlBlock::uxPriority.
void vTaskAllocateMPURegions | ( | xTaskHandle | xTask, |
const xMemoryRegion *const | pxRegions | ||
) |
void vTaskCleanUpResources | ( | void | ) |
void vTaskDelay | ( | portTickType | xTicksToDelay | ) |
void vTaskDelayUntil | ( | portTickType *const | pxPreviousWakeTime, |
portTickType | xTimeIncrement | ||
) |
References configASSERT, pdFALSE, pdTRUE, portYIELD_WITHIN_API, prvAddCurrentTaskToDelayedList(), pxCurrentTCB, traceTASK_DELAY_UNTIL, vListRemove(), vTaskSuspendAll(), tskTaskControlBlock::xGenericListItem, xTaskResumeAll(), and xTickCount.
Referenced by device_cdc_task(), host_cdc_task(), usb_device_task(), and usb_host_task().
void vTaskDelete | ( | xTaskHandle | pxTaskToDelete | ) |
References pdFALSE, portYIELD_WITHIN_API, prvGetTCBFromHandle, xLIST_ITEM::pvContainer, pxCurrentTCB, taskENTER_CRITICAL, taskEXIT_CRITICAL, traceTASK_DELETE, uxTaskNumber, uxTasksDeleted, vListInsertEnd(), vListRemove(), tskTaskControlBlock::xEventListItem, tskTaskControlBlock::xGenericListItem, xSchedulerRunning, and xTasksWaitingTermination.
Referenced by usb_task().
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 | ||
) |
void vTaskPlaceOnEventListRestricted | ( | const xList *const | pxEventList, |
portTickType | xTicksToWait | ||
) |
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, traceTASK_PRIORITY_SET, tskTaskControlBlock::uxPriority, vListRemove(), tskTaskControlBlock::xEventListItem, and tskTaskControlBlock::xGenericListItem.
void vTaskResume | ( | xTaskHandle | pxTaskToResume | ) |
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, 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 vTaskStartTrace | ( | signed char * | pcBuffer, |
unsigned long | ulBufferSize | ||
) |
void vTaskSuspend | ( | xTaskHandle | pxTaskToSuspend | ) |
References pdFALSE, portYIELD_WITHIN_API, prvGetTCBFromHandle, xLIST_ITEM::pvContainer, pxCurrentTCB, taskENTER_CRITICAL, taskEXIT_CRITICAL, traceTASK_SUSPEND, uxCurrentNumberOfTasks, vListInsertEnd(), vListRemove(), vTaskSwitchContext(), tskTaskControlBlock::xEventListItem, tskTaskControlBlock::xGenericListItem, xSchedulerRunning, and xSuspendedTaskList.
void vTaskSuspendAll | ( | void | ) |
References uxSchedulerSuspended.
Referenced by prvCheckTasksWaitingTermination(), pvPortMalloc(), vPortFree(), vTaskDelay(), vTaskDelayUntil(), xQueueGenericReceive(), and xQueueGenericSend().
void vTaskSwitchContext | ( | void | ) |
References configASSERT, listGET_OWNER_OF_NEXT_ENTRY, listLIST_IS_EMPTY, pdFALSE, pdTRUE, pxCurrentTCB, pxReadyTasksLists, taskFIRST_CHECK_FOR_STACK_OVERFLOW, taskSECOND_CHECK_FOR_STACK_OVERFLOW, traceTASK_SWITCHED_IN, traceTASK_SWITCHED_OUT, uxSchedulerSuspended, uxTopReadyPriority, vWriteTraceToBuffer, and xMissedYield.
Referenced by vTaskSuspend().
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.
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().
portBASE_TYPE xTaskGetSchedulerState | ( | void | ) |
portTickType xTaskGetTickCount | ( | void | ) |
References taskENTER_CRITICAL, taskEXIT_CRITICAL, and xTickCount.
Referenced by device_cdc_task(), host_cdc_task(), prvCheckDelayedList(), usb_device_task(), and usb_host_task().
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, tskTaskControlBlock::uxPriority, uxSchedulerSuspended, vListInsertEnd(), vListRemove(), tskTaskControlBlock::xEventListItem, tskTaskControlBlock::xGenericListItem, and xPendingReadyList.
Referenced by prvUnlockQueue(), xQueueGenericReceive(), 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, uxMissedTicks, tskTaskControlBlock::uxPriority, uxSchedulerSuspended, vListRemove(), vTaskIncrementTick(), tskTaskControlBlock::xEventListItem, tskTaskControlBlock::xGenericListItem, xMissedYield, and xPendingReadyList.
Referenced by prvCheckTasksWaitingTermination(), 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, tskTaskControlBlock::uxPriority, uxSchedulerSuspended, vListInsertEnd(), vListRemove(), tskTaskControlBlock::xEventListItem, tskTaskControlBlock::xGenericListItem, xPendingReadyList, and xTaskIsTaskSuspended().