STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
task.h File Reference
#include "list.h"
Include dependency graph for task.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  xTIME_OUT
struct  xMEMORY_REGION
struct  xTASK_PARAMETERS
struct  xTASK_STATUS

Macros

#define tskKERNEL_VERSION_NUMBER   "V10.6.2"
#define tskKERNEL_VERSION_MAJOR   10
#define tskKERNEL_VERSION_MINOR   6
#define tskKERNEL_VERSION_BUILD   2
#define tskMPU_REGION_READ_ONLY   ( 1UL << 0UL )
#define tskMPU_REGION_READ_WRITE   ( 1UL << 1UL )
#define tskMPU_REGION_EXECUTE_NEVER   ( 1UL << 2UL )
#define tskMPU_REGION_NORMAL_MEMORY   ( 1UL << 3UL )
#define tskMPU_REGION_DEVICE_MEMORY   ( 1UL << 4UL )
#define tskMPU_READ_PERMISSION   ( 1UL << 0UL )
#define tskMPU_WRITE_PERMISSION   ( 1UL << 1UL )
#define tskDEFAULT_INDEX_TO_NOTIFY   ( 0 )
#define tskIDLE_PRIORITY   ( ( UBaseType_t ) 0U )
 Defines the priority used by the idle task.
#define taskYIELD()
#define taskENTER_CRITICAL()
#define taskENTER_CRITICAL_FROM_ISR()
#define taskEXIT_CRITICAL()
#define taskEXIT_CRITICAL_FROM_ISR(x)
#define taskDISABLE_INTERRUPTS()
#define taskENABLE_INTERRUPTS()
#define taskSCHEDULER_SUSPENDED   ( ( BaseType_t ) 0 )
#define taskSCHEDULER_NOT_STARTED   ( ( BaseType_t ) 1 )
#define taskSCHEDULER_RUNNING   ( ( BaseType_t ) 2 )
#define vTaskDelayUntil(pxPreviousWakeTime, xTimeIncrement)
#define xTaskNotify(xTaskToNotify, ulValue, eAction)
#define xTaskNotifyIndexed(xTaskToNotify, uxIndexToNotify, ulValue, eAction)
#define xTaskNotifyAndQuery(xTaskToNotify, ulValue, eAction, pulPreviousNotifyValue)
#define xTaskNotifyAndQueryIndexed(xTaskToNotify, uxIndexToNotify, ulValue, eAction, pulPreviousNotifyValue)
#define xTaskNotifyFromISR(xTaskToNotify, ulValue, eAction, pxHigherPriorityTaskWoken)
#define xTaskNotifyIndexedFromISR(xTaskToNotify, uxIndexToNotify, ulValue, eAction, pxHigherPriorityTaskWoken)
#define xTaskNotifyAndQueryIndexedFromISR(xTaskToNotify, uxIndexToNotify, ulValue, eAction, pulPreviousNotificationValue, pxHigherPriorityTaskWoken)
#define xTaskNotifyAndQueryFromISR(xTaskToNotify, ulValue, eAction, pulPreviousNotificationValue, pxHigherPriorityTaskWoken)
#define xTaskNotifyWait(ulBitsToClearOnEntry, ulBitsToClearOnExit, pulNotificationValue, xTicksToWait)
#define xTaskNotifyWaitIndexed(uxIndexToWaitOn, ulBitsToClearOnEntry, ulBitsToClearOnExit, pulNotificationValue, xTicksToWait)
#define xTaskNotifyGive(xTaskToNotify)
#define xTaskNotifyGiveIndexed(xTaskToNotify, uxIndexToNotify)
#define vTaskNotifyGiveFromISR(xTaskToNotify, pxHigherPriorityTaskWoken)
#define vTaskNotifyGiveIndexedFromISR(xTaskToNotify, uxIndexToNotify, pxHigherPriorityTaskWoken)
#define ulTaskNotifyTake(xClearCountOnExit, xTicksToWait)
#define ulTaskNotifyTakeIndexed(uxIndexToWaitOn, xClearCountOnExit, xTicksToWait)
#define xTaskNotifyStateClear(xTask)
#define xTaskNotifyStateClearIndexed(xTask, uxIndexToClear)
#define ulTaskNotifyValueClear(xTask, ulBitsToClear)
#define ulTaskNotifyValueClearIndexed(xTask, uxIndexToClear, ulBitsToClear)

Typedefs

typedef struct tskTaskControlBlock * TaskHandle_t
typedef BaseType_t(* TaskHookFunction_t) (void *)
typedef struct xTIME_OUT TimeOut_t
typedef struct xMEMORY_REGION MemoryRegion_t
typedef struct xTASK_PARAMETERS TaskParameters_t
typedef struct xTASK_STATUS TaskStatus_t

Enumerations

enum  eTaskState {
  eRunning = 0 , eReady , eBlocked , eSuspended ,
  eDeleted , eInvalid
}
enum  eNotifyAction {
  eNoAction = 0 , eSetBits , eIncrement , eSetValueWithOverwrite ,
  eSetValueWithoutOverwrite
}
enum  eSleepModeStatus { eAbortSleep = 0 , eStandardSleep }

Functions

void vTaskAllocateMPURegions (TaskHandle_t xTask, const MemoryRegion_t *const pxRegions) PRIVILEGED_FUNCTION
void vTaskDelete (TaskHandle_t xTaskToDelete) PRIVILEGED_FUNCTION
void vTaskDelay (const TickType_t xTicksToDelay) PRIVILEGED_FUNCTION
BaseType_t xTaskDelayUntil (TickType_t *const pxPreviousWakeTime, const TickType_t xTimeIncrement) PRIVILEGED_FUNCTION
BaseType_t xTaskAbortDelay (TaskHandle_t xTask) PRIVILEGED_FUNCTION
UBaseType_t uxTaskPriorityGet (const TaskHandle_t xTask) PRIVILEGED_FUNCTION
UBaseType_t uxTaskPriorityGetFromISR (const TaskHandle_t xTask) PRIVILEGED_FUNCTION
 task.
eTaskState eTaskGetState (TaskHandle_t xTask) PRIVILEGED_FUNCTION
 task.
void vTaskGetInfo (TaskHandle_t xTask, TaskStatus_t *pxTaskStatus, BaseType_t xGetFreeStackSpace, eTaskState eState) PRIVILEGED_FUNCTION
void vTaskPrioritySet (TaskHandle_t xTask, UBaseType_t uxNewPriority) PRIVILEGED_FUNCTION
void vTaskSuspend (TaskHandle_t xTaskToSuspend) PRIVILEGED_FUNCTION
void vTaskResume (TaskHandle_t xTaskToResume) PRIVILEGED_FUNCTION
BaseType_t xTaskResumeFromISR (TaskHandle_t xTaskToResume) PRIVILEGED_FUNCTION
void vTaskStartScheduler (void) PRIVILEGED_FUNCTION
void vTaskEndScheduler (void) PRIVILEGED_FUNCTION
void vTaskSuspendAll (void) PRIVILEGED_FUNCTION
BaseType_t xTaskResumeAll (void) PRIVILEGED_FUNCTION
TickType_t xTaskGetTickCount (void) PRIVILEGED_FUNCTION
TickType_t xTaskGetTickCountFromISR (void) PRIVILEGED_FUNCTION
UBaseType_t uxTaskGetNumberOfTasks (void) PRIVILEGED_FUNCTION
char * pcTaskGetName (TaskHandle_t xTaskToQuery) PRIVILEGED_FUNCTION
TaskHandle_t xTaskGetHandle (const char *pcNameToQuery) PRIVILEGED_FUNCTION
UBaseType_t uxTaskGetStackHighWaterMark (TaskHandle_t xTask) PRIVILEGED_FUNCTION
 task.h
configSTACK_DEPTH_TYPE uxTaskGetStackHighWaterMark2 (TaskHandle_t xTask) PRIVILEGED_FUNCTION
 task.h
BaseType_t xTaskCallApplicationTaskHook (TaskHandle_t xTask, void *pvParameter) PRIVILEGED_FUNCTION
 task.h
TaskHandle_t xTaskGetIdleTaskHandle (void) PRIVILEGED_FUNCTION
 xTaskGetIdleTaskHandle() is only available if INCLUDE_xTaskGetIdleTaskHandle is set to 1 in FreeRTOSConfig.h.
UBaseType_t uxTaskGetSystemState (TaskStatus_t *const pxTaskStatusArray, const UBaseType_t uxArraySize, configRUN_TIME_COUNTER_TYPE *const pulTotalRunTime) PRIVILEGED_FUNCTION
 configUSE_TRACE_FACILITY must be defined as 1 in FreeRTOSConfig.h for uxTaskGetSystemState() to be available.
void vTaskList (char *pcWriteBuffer) PRIVILEGED_FUNCTION
void vTaskGetRunTimeStats (char *pcWriteBuffer) PRIVILEGED_FUNCTION
configRUN_TIME_COUNTER_TYPE ulTaskGetRunTimeCounter (const TaskHandle_t xTask) PRIVILEGED_FUNCTION
configRUN_TIME_COUNTER_TYPE ulTaskGetRunTimePercent (const TaskHandle_t xTask) PRIVILEGED_FUNCTION
configRUN_TIME_COUNTER_TYPE ulTaskGetIdleRunTimeCounter (void) PRIVILEGED_FUNCTION
configRUN_TIME_COUNTER_TYPE ulTaskGetIdleRunTimePercent (void) PRIVILEGED_FUNCTION
BaseType_t xTaskGenericNotify (TaskHandle_t xTaskToNotify, UBaseType_t uxIndexToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotificationValue) PRIVILEGED_FUNCTION
BaseType_t xTaskGenericNotifyFromISR (TaskHandle_t xTaskToNotify, UBaseType_t uxIndexToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotificationValue, BaseType_t *pxHigherPriorityTaskWoken) PRIVILEGED_FUNCTION
BaseType_t xTaskGenericNotifyWait (UBaseType_t uxIndexToWaitOn, uint32_t ulBitsToClearOnEntry, uint32_t ulBitsToClearOnExit, uint32_t *pulNotificationValue, TickType_t xTicksToWait) PRIVILEGED_FUNCTION
void vTaskGenericNotifyGiveFromISR (TaskHandle_t xTaskToNotify, UBaseType_t uxIndexToNotify, BaseType_t *pxHigherPriorityTaskWoken) PRIVILEGED_FUNCTION
uint32_t ulTaskGenericNotifyTake (UBaseType_t uxIndexToWaitOn, BaseType_t xClearCountOnExit, TickType_t xTicksToWait) PRIVILEGED_FUNCTION
BaseType_t xTaskGenericNotifyStateClear (TaskHandle_t xTask, UBaseType_t uxIndexToClear) PRIVILEGED_FUNCTION
uint32_t ulTaskGenericNotifyValueClear (TaskHandle_t xTask, UBaseType_t uxIndexToClear, uint32_t ulBitsToClear) PRIVILEGED_FUNCTION
void vTaskSetTimeOutState (TimeOut_t *const pxTimeOut) PRIVILEGED_FUNCTION
BaseType_t xTaskCheckForTimeOut (TimeOut_t *const pxTimeOut, TickType_t *const pxTicksToWait) PRIVILEGED_FUNCTION
BaseType_t xTaskCatchUpTicks (TickType_t xTicksToCatchUp) PRIVILEGED_FUNCTION
BaseType_t xTaskIncrementTick (void) PRIVILEGED_FUNCTION
void vTaskPlaceOnEventList (List_t *const pxEventList, const TickType_t xTicksToWait) PRIVILEGED_FUNCTION
void vTaskPlaceOnUnorderedEventList (List_t *pxEventList, const TickType_t xItemValue, const TickType_t xTicksToWait) PRIVILEGED_FUNCTION
void vTaskPlaceOnEventListRestricted (List_t *const pxEventList, TickType_t xTicksToWait, const BaseType_t xWaitIndefinitely) PRIVILEGED_FUNCTION
BaseType_t xTaskRemoveFromEventList (const List_t *const pxEventList) PRIVILEGED_FUNCTION
void vTaskRemoveFromUnorderedEventList (ListItem_t *pxEventListItem, const TickType_t xItemValue) PRIVILEGED_FUNCTION
portDONT_DISCARD void vTaskSwitchContext (void) PRIVILEGED_FUNCTION
TickType_t uxTaskResetEventItemValue (void) PRIVILEGED_FUNCTION
TaskHandle_t xTaskGetCurrentTaskHandle (void) PRIVILEGED_FUNCTION
void vTaskMissedYield (void) PRIVILEGED_FUNCTION
BaseType_t xTaskGetSchedulerState (void) PRIVILEGED_FUNCTION
BaseType_t xTaskPriorityInherit (TaskHandle_t const pxMutexHolder) PRIVILEGED_FUNCTION
BaseType_t xTaskPriorityDisinherit (TaskHandle_t const pxMutexHolder) PRIVILEGED_FUNCTION
void vTaskPriorityDisinheritAfterTimeout (TaskHandle_t const pxMutexHolder, UBaseType_t uxHighestPriorityWaitingTask) PRIVILEGED_FUNCTION
UBaseType_t uxTaskGetTaskNumber (TaskHandle_t xTask) PRIVILEGED_FUNCTION
void vTaskSetTaskNumber (TaskHandle_t xTask, const UBaseType_t uxHandle) PRIVILEGED_FUNCTION
void vTaskStepTick (TickType_t xTicksToJump) PRIVILEGED_FUNCTION
eSleepModeStatus eTaskConfirmSleepModeStatus (void) PRIVILEGED_FUNCTION
TaskHandle_t pvTaskIncrementMutexHeldCount (void) PRIVILEGED_FUNCTION
void vTaskInternalSetTimeOutState (TimeOut_t *const pxTimeOut) PRIVILEGED_FUNCTION

Macro Definition Documentation

◆ taskDISABLE_INTERRUPTS

#define taskDISABLE_INTERRUPTS ( )
Value:
#define portDISABLE_INTERRUPTS()
Definition portmacro.h:109

Definition at line 241 of file task.h.

◆ taskENABLE_INTERRUPTS

#define taskENABLE_INTERRUPTS ( )
Value:
#define portENABLE_INTERRUPTS()
Definition portmacro.h:110

Definition at line 251 of file task.h.

◆ taskENTER_CRITICAL

◆ taskENTER_CRITICAL_FROM_ISR

#define taskENTER_CRITICAL_FROM_ISR ( )
Value:
#define portSET_INTERRUPT_MASK_FROM_ISR()
Definition portmacro.h:107

Definition at line 216 of file task.h.

Referenced by osMessageQueueGetSpace().

◆ taskEXIT_CRITICAL

◆ taskEXIT_CRITICAL_FROM_ISR

#define taskEXIT_CRITICAL_FROM_ISR ( x)
Value:
#define portCLEAR_INTERRUPT_MASK_FROM_ISR(x)
Definition portmacro.h:108

Definition at line 231 of file task.h.

Referenced by osMessageQueueGetSpace().

◆ taskSCHEDULER_NOT_STARTED

#define taskSCHEDULER_NOT_STARTED   ( ( BaseType_t ) 1 )

◆ taskSCHEDULER_RUNNING

#define taskSCHEDULER_RUNNING   ( ( BaseType_t ) 2 )

Definition at line 258 of file task.h.

Referenced by osKernelGetState(), osKernelLock(), osKernelRestoreLock(), and osKernelUnlock().

◆ taskSCHEDULER_SUSPENDED

◆ taskYIELD

#define taskYIELD ( )
Value:
#define portYIELD()
Definition portmacro.h:88

Definition at line 201 of file task.h.

Referenced by osThreadYield(), and portTASK_FUNCTION().

◆ tskDEFAULT_INDEX_TO_NOTIFY

#define tskDEFAULT_INDEX_TO_NOTIFY   ( 0 )

Definition at line 79 of file task.h.

◆ tskIDLE_PRIORITY

#define tskIDLE_PRIORITY   ( ( UBaseType_t ) 0U )

Defines the priority used by the idle task.

This must not be modified.

Definition at line 191 of file task.h.

Referenced by portTASK_FUNCTION().

◆ tskKERNEL_VERSION_BUILD

#define tskKERNEL_VERSION_BUILD   2

Definition at line 59 of file task.h.

◆ tskKERNEL_VERSION_MAJOR

#define tskKERNEL_VERSION_MAJOR   10

Definition at line 57 of file task.h.

◆ tskKERNEL_VERSION_MINOR

#define tskKERNEL_VERSION_MINOR   6

Definition at line 58 of file task.h.

◆ tskKERNEL_VERSION_NUMBER

#define tskKERNEL_VERSION_NUMBER   "V10.6.2"

Definition at line 56 of file task.h.

◆ tskMPU_READ_PERMISSION

#define tskMPU_READ_PERMISSION   ( 1UL << 0UL )

Definition at line 71 of file task.h.

◆ tskMPU_REGION_DEVICE_MEMORY

#define tskMPU_REGION_DEVICE_MEMORY   ( 1UL << 4UL )

Definition at line 67 of file task.h.

◆ tskMPU_REGION_EXECUTE_NEVER

#define tskMPU_REGION_EXECUTE_NEVER   ( 1UL << 2UL )

Definition at line 65 of file task.h.

◆ tskMPU_REGION_NORMAL_MEMORY

#define tskMPU_REGION_NORMAL_MEMORY   ( 1UL << 3UL )

Definition at line 66 of file task.h.

◆ tskMPU_REGION_READ_ONLY

#define tskMPU_REGION_READ_ONLY   ( 1UL << 0UL )

Definition at line 63 of file task.h.

◆ tskMPU_REGION_READ_WRITE

#define tskMPU_REGION_READ_WRITE   ( 1UL << 1UL )

Definition at line 64 of file task.h.

◆ tskMPU_WRITE_PERMISSION

#define tskMPU_WRITE_PERMISSION   ( 1UL << 1UL )

Definition at line 72 of file task.h.

◆ ulTaskNotifyTake

#define ulTaskNotifyTake ( xClearCountOnExit,
xTicksToWait )
Value:
ulTaskGenericNotifyTake( ( tskDEFAULT_INDEX_TO_NOTIFY ), ( xClearCountOnExit ), ( xTicksToWait ) )
uint32_t ulTaskGenericNotifyTake(UBaseType_t uxIndexToWaitOn, BaseType_t xClearCountOnExit, TickType_t xTicksToWait) PRIVILEGED_FUNCTION
#define tskDEFAULT_INDEX_TO_NOTIFY
Definition task.h:79

Definition at line 2727 of file task.h.

◆ ulTaskNotifyTakeIndexed

#define ulTaskNotifyTakeIndexed ( uxIndexToWaitOn,
xClearCountOnExit,
xTicksToWait )
Value:
ulTaskGenericNotifyTake( ( uxIndexToWaitOn ), ( xClearCountOnExit ), ( xTicksToWait ) )

Definition at line 2729 of file task.h.

◆ ulTaskNotifyValueClear

#define ulTaskNotifyValueClear ( xTask,
ulBitsToClear )
Value:
ulTaskGenericNotifyValueClear( ( xTask ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( ulBitsToClear ) )
uint32_t ulTaskGenericNotifyValueClear(TaskHandle_t xTask, UBaseType_t uxIndexToClear, uint32_t ulBitsToClear) PRIVILEGED_FUNCTION

Definition at line 2857 of file task.h.

◆ ulTaskNotifyValueClearIndexed

#define ulTaskNotifyValueClearIndexed ( xTask,
uxIndexToClear,
ulBitsToClear )
Value:
ulTaskGenericNotifyValueClear( ( xTask ), ( uxIndexToClear ), ( ulBitsToClear ) )

Definition at line 2859 of file task.h.

◆ vTaskDelayUntil

#define vTaskDelayUntil ( pxPreviousWakeTime,
xTimeIncrement )
Value:
do { \
( void ) xTaskDelayUntil( ( pxPreviousWakeTime ), ( xTimeIncrement ) ); \
} while( 0 )
BaseType_t xTaskDelayUntil(TickType_t *const pxPreviousWakeTime, const TickType_t xTimeIncrement) PRIVILEGED_FUNCTION

Definition at line 873 of file task.h.

◆ vTaskNotifyGiveFromISR

#define vTaskNotifyGiveFromISR ( xTaskToNotify,
pxHigherPriorityTaskWoken )
Value:
vTaskGenericNotifyGiveFromISR( ( xTaskToNotify ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( pxHigherPriorityTaskWoken ) )
void vTaskGenericNotifyGiveFromISR(TaskHandle_t xTaskToNotify, UBaseType_t uxIndexToNotify, BaseType_t *pxHigherPriorityTaskWoken) PRIVILEGED_FUNCTION

Definition at line 2621 of file task.h.

◆ vTaskNotifyGiveIndexedFromISR

#define vTaskNotifyGiveIndexedFromISR ( xTaskToNotify,
uxIndexToNotify,
pxHigherPriorityTaskWoken )
Value:
vTaskGenericNotifyGiveFromISR( ( xTaskToNotify ), ( uxIndexToNotify ), ( pxHigherPriorityTaskWoken ) )

Definition at line 2623 of file task.h.

◆ xTaskNotify

#define xTaskNotify ( xTaskToNotify,
ulValue,
eAction )
Value:
xTaskGenericNotify( ( xTaskToNotify ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( ulValue ), ( eAction ), NULL )
#define NULL
Definition usbd_def.h:44
BaseType_t xTaskGenericNotify(TaskHandle_t xTaskToNotify, UBaseType_t uxIndexToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotificationValue) PRIVILEGED_FUNCTION

Definition at line 2161 of file task.h.

◆ xTaskNotifyAndQuery

#define xTaskNotifyAndQuery ( xTaskToNotify,
ulValue,
eAction,
pulPreviousNotifyValue )
Value:
xTaskGenericNotify( ( xTaskToNotify ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( ulValue ), ( eAction ), ( pulPreviousNotifyValue ) )

Definition at line 2190 of file task.h.

◆ xTaskNotifyAndQueryFromISR

#define xTaskNotifyAndQueryFromISR ( xTaskToNotify,
ulValue,
eAction,
pulPreviousNotificationValue,
pxHigherPriorityTaskWoken )
Value:
xTaskGenericNotifyFromISR( ( xTaskToNotify ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( ulValue ), ( eAction ), ( pulPreviousNotificationValue ), ( pxHigherPriorityTaskWoken ) )
BaseType_t xTaskGenericNotifyFromISR(TaskHandle_t xTaskToNotify, UBaseType_t uxIndexToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotificationValue, BaseType_t *pxHigherPriorityTaskWoken) PRIVILEGED_FUNCTION

Definition at line 2345 of file task.h.

◆ xTaskNotifyAndQueryIndexed

#define xTaskNotifyAndQueryIndexed ( xTaskToNotify,
uxIndexToNotify,
ulValue,
eAction,
pulPreviousNotifyValue )
Value:
xTaskGenericNotify( ( xTaskToNotify ), ( uxIndexToNotify ), ( ulValue ), ( eAction ), ( pulPreviousNotifyValue ) )

Definition at line 2192 of file task.h.

◆ xTaskNotifyAndQueryIndexedFromISR

#define xTaskNotifyAndQueryIndexedFromISR ( xTaskToNotify,
uxIndexToNotify,
ulValue,
eAction,
pulPreviousNotificationValue,
pxHigherPriorityTaskWoken )
Value:
xTaskGenericNotifyFromISR( ( xTaskToNotify ), ( uxIndexToNotify ), ( ulValue ), ( eAction ), ( pulPreviousNotificationValue ), ( pxHigherPriorityTaskWoken ) )

Definition at line 2343 of file task.h.

◆ xTaskNotifyFromISR

#define xTaskNotifyFromISR ( xTaskToNotify,
ulValue,
eAction,
pxHigherPriorityTaskWoken )
Value:
xTaskGenericNotifyFromISR( ( xTaskToNotify ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( ulValue ), ( eAction ), NULL, ( pxHigherPriorityTaskWoken ) )

Definition at line 2314 of file task.h.

Referenced by xStreamBufferReceiveCompletedFromISR(), and xStreamBufferSendCompletedFromISR().

◆ xTaskNotifyGive

#define xTaskNotifyGive ( xTaskToNotify)
Value:
xTaskGenericNotify( ( xTaskToNotify ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( 0 ), eIncrement, NULL )
@ eIncrement
Definition task.h:116

Definition at line 2534 of file task.h.

◆ xTaskNotifyGiveIndexed

#define xTaskNotifyGiveIndexed ( xTaskToNotify,
uxIndexToNotify )
Value:
xTaskGenericNotify( ( xTaskToNotify ), ( uxIndexToNotify ), ( 0 ), eIncrement, NULL )

Definition at line 2536 of file task.h.

◆ xTaskNotifyIndexed

#define xTaskNotifyIndexed ( xTaskToNotify,
uxIndexToNotify,
ulValue,
eAction )
Value:
xTaskGenericNotify( ( xTaskToNotify ), ( uxIndexToNotify ), ( ulValue ), ( eAction ), NULL )

Definition at line 2163 of file task.h.

◆ xTaskNotifyIndexedFromISR

#define xTaskNotifyIndexedFromISR ( xTaskToNotify,
uxIndexToNotify,
ulValue,
eAction,
pxHigherPriorityTaskWoken )
Value:
xTaskGenericNotifyFromISR( ( xTaskToNotify ), ( uxIndexToNotify ), ( ulValue ), ( eAction ), NULL, ( pxHigherPriorityTaskWoken ) )

Definition at line 2316 of file task.h.

◆ xTaskNotifyStateClear

#define xTaskNotifyStateClear ( xTask)
Value:
BaseType_t xTaskGenericNotifyStateClear(TaskHandle_t xTask, UBaseType_t uxIndexToClear) PRIVILEGED_FUNCTION

Definition at line 2791 of file task.h.

Referenced by xStreamBufferReceive(), and xStreamBufferSend().

◆ xTaskNotifyStateClearIndexed

#define xTaskNotifyStateClearIndexed ( xTask,
uxIndexToClear )
Value:
xTaskGenericNotifyStateClear( ( xTask ), ( uxIndexToClear ) )

Definition at line 2793 of file task.h.

◆ xTaskNotifyWait

#define xTaskNotifyWait ( ulBitsToClearOnEntry,
ulBitsToClearOnExit,
pulNotificationValue,
xTicksToWait )
Value:
xTaskGenericNotifyWait( tskDEFAULT_INDEX_TO_NOTIFY, ( ulBitsToClearOnEntry ), ( ulBitsToClearOnExit ), ( pulNotificationValue ), ( xTicksToWait ) )
BaseType_t xTaskGenericNotifyWait(UBaseType_t uxIndexToWaitOn, uint32_t ulBitsToClearOnEntry, uint32_t ulBitsToClearOnExit, uint32_t *pulNotificationValue, TickType_t xTicksToWait) PRIVILEGED_FUNCTION

Definition at line 2457 of file task.h.

Referenced by xStreamBufferReceive(), and xStreamBufferSend().

◆ xTaskNotifyWaitIndexed

#define xTaskNotifyWaitIndexed ( uxIndexToWaitOn,
ulBitsToClearOnEntry,
ulBitsToClearOnExit,
pulNotificationValue,
xTicksToWait )
Value:
xTaskGenericNotifyWait( ( uxIndexToWaitOn ), ( ulBitsToClearOnEntry ), ( ulBitsToClearOnExit ), ( pulNotificationValue ), ( xTicksToWait ) )

Definition at line 2459 of file task.h.

Typedef Documentation

◆ MemoryRegion_t

◆ TaskHandle_t

Definition at line 92 of file task.h.

◆ TaskHookFunction_t

typedef BaseType_t(* TaskHookFunction_t) (void *)

Definition at line 98 of file task.h.

◆ TaskParameters_t

◆ TaskStatus_t

typedef struct xTASK_STATUS TaskStatus_t

◆ TimeOut_t

typedef struct xTIME_OUT TimeOut_t

Enumeration Type Documentation

◆ eNotifyAction

Enumerator
eNoAction 
eSetBits 
eIncrement 
eSetValueWithOverwrite 
eSetValueWithoutOverwrite 

Definition at line 112 of file task.h.

◆ eSleepModeStatus

Enumerator
eAbortSleep 
eStandardSleep 

Definition at line 177 of file task.h.

◆ eTaskState

enum eTaskState
Enumerator
eRunning 
eReady 
eBlocked 
eSuspended 
eDeleted 
eInvalid 

Definition at line 101 of file task.h.

Function Documentation

◆ eTaskConfirmSleepModeStatus()

eSleepModeStatus eTaskConfirmSleepModeStatus ( void )

References PRIVILEGED_FUNCTION.

◆ eTaskGetState()

eTaskState eTaskGetState ( TaskHandle_t xTask)

task.

h

eTaskState
Definition task.h:102
struct tskTaskControlBlock * TaskHandle_t
Definition task.h:92
eTaskState eTaskGetState(TaskHandle_t xTask) PRIVILEGED_FUNCTION
task.

INCLUDE_eTaskGetState 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.

Parameters
xTaskHandle of the task to be queried.
Returns
The state of xTask at the time the function was called. Note the state of the task might change between the function being called, and the functions return value being tested by the calling task.

References PRIVILEGED_FUNCTION.

Referenced by osThreadGetState(), and osThreadTerminate().

◆ pcTaskGetName()

char * pcTaskGetName ( TaskHandle_t xTaskToQuery)

Definition at line 2353 of file tasks.c.

References configASSERT, tskTaskControlBlock::pcTaskName, and prvGetTCBFromHandle.

Referenced by osThreadGetName().

◆ pvTaskIncrementMutexHeldCount()

TaskHandle_t pvTaskIncrementMutexHeldCount ( void )

References PRIVILEGED_FUNCTION.

Referenced by xQueueSemaphoreTake().

◆ ulTaskGenericNotifyTake()

uint32_t ulTaskGenericNotifyTake ( UBaseType_t uxIndexToWaitOn,
BaseType_t xClearCountOnExit,
TickType_t xTicksToWait )

References PRIVILEGED_FUNCTION.

◆ ulTaskGenericNotifyValueClear()

uint32_t ulTaskGenericNotifyValueClear ( TaskHandle_t xTask,
UBaseType_t uxIndexToClear,
uint32_t ulBitsToClear )

References PRIVILEGED_FUNCTION.

◆ ulTaskGetIdleRunTimeCounter()

configRUN_TIME_COUNTER_TYPE ulTaskGetIdleRunTimeCounter ( void )

◆ ulTaskGetIdleRunTimePercent()

configRUN_TIME_COUNTER_TYPE ulTaskGetIdleRunTimePercent ( void )

◆ ulTaskGetRunTimeCounter()

configRUN_TIME_COUNTER_TYPE ulTaskGetRunTimeCounter ( const TaskHandle_t xTask)

◆ ulTaskGetRunTimePercent()

configRUN_TIME_COUNTER_TYPE ulTaskGetRunTimePercent ( const TaskHandle_t xTask)

◆ uxTaskGetNumberOfTasks()

UBaseType_t uxTaskGetNumberOfTasks ( void )

Definition at line 2345 of file tasks.c.

References uxCurrentNumberOfTasks.

Referenced by osThreadEnumerate(), and osThreadGetCount().

◆ uxTaskGetStackHighWaterMark()

UBaseType_t uxTaskGetStackHighWaterMark ( TaskHandle_t xTask)

task.h

unsigned long UBaseType_t
Definition portmacro.h:60
UBaseType_t uxTaskGetStackHighWaterMark(TaskHandle_t xTask) PRIVILEGED_FUNCTION
task.h

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.

uxTaskGetStackHighWaterMark() and uxTaskGetStackHighWaterMark2() are the same except for their return type. Using configSTACK_DEPTH_TYPE allows the user to determine the return type. It gets around the problem of the value overflowing on 8-bit types without breaking backward compatibility for applications that expect an 8-bit return type.

Parameters
xTaskHandle of the task associated with the stack to be checked. Set xTask to NULL to check the stack of the calling task.
Returns
The smallest amount of free stack space there has been (in words, so actual spaces on the stack rather than bytes) since the task referenced by xTask was created.

References PRIVILEGED_FUNCTION.

Referenced by osThreadGetStackSpace().

◆ uxTaskGetStackHighWaterMark2()

configSTACK_DEPTH_TYPE uxTaskGetStackHighWaterMark2 ( TaskHandle_t xTask)

task.h

#define configSTACK_DEPTH_TYPE
Definition FreeRTOS.h:998
configSTACK_DEPTH_TYPE uxTaskGetStackHighWaterMark2(TaskHandle_t xTask) PRIVILEGED_FUNCTION
task.h

INCLUDE_uxTaskGetStackHighWaterMark2 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.

uxTaskGetStackHighWaterMark() and uxTaskGetStackHighWaterMark2() are the same except for their return type. Using configSTACK_DEPTH_TYPE allows the user to determine the return type. It gets around the problem of the value overflowing on 8-bit types without breaking backward compatibility for applications that expect an 8-bit return type.

Parameters
xTaskHandle of the task associated with the stack to be checked. Set xTask to NULL to check the stack of the calling task.
Returns
The smallest amount of free stack space there has been (in words, so actual spaces on the stack rather than bytes) since the task referenced by xTask was created.

References configSTACK_DEPTH_TYPE, and PRIVILEGED_FUNCTION.

◆ uxTaskGetSystemState()

UBaseType_t uxTaskGetSystemState ( TaskStatus_t *const pxTaskStatusArray,
const UBaseType_t uxArraySize,
configRUN_TIME_COUNTER_TYPE *const pulTotalRunTime )

configUSE_TRACE_FACILITY must be defined as 1 in FreeRTOSConfig.h for uxTaskGetSystemState() to be available.

uxTaskGetSystemState() populates an TaskStatus_t structure for each task in the system. TaskStatus_t structures contain, among other things, members for the task handle, task name, task priority, task state, and total amount of run time consumed by the task. See the TaskStatus_t structure definition in this file for the full member list.

NOTE: This function is intended for debugging use only as its use results in the scheduler remaining suspended for an extended period.

Parameters
pxTaskStatusArrayA pointer to an array of TaskStatus_t structures. The array must contain at least one TaskStatus_t structure for each task that is under the control of the RTOS. The number of tasks under the control of the RTOS can be determined using the uxTaskGetNumberOfTasks() API function.
uxArraySizeThe size of the array pointed to by the pxTaskStatusArray parameter. The size is specified as the number of indexes in the array, or the number of TaskStatus_t structures contained in the array, not by the number of bytes in the array.
pulTotalRunTimeIf configGENERATE_RUN_TIME_STATS is set to 1 in FreeRTOSConfig.h then *pulTotalRunTime is set by uxTaskGetSystemState() to the total run time (as defined by the run time stats clock, see https://www.FreeRTOS.org/rtos-run-time-stats.html) since the target booted. pulTotalRunTime can be set to NULL to omit the total run time information.
Returns
The number of TaskStatus_t structures that were populated by uxTaskGetSystemState(). This should equal the number returned by the uxTaskGetNumberOfTasks() API function, but will be zero if the value passed in the uxArraySize parameter was too small.

Example usage:

// This example demonstrates how a human readable table of run time stats
// information is generated from raw data provided by uxTaskGetSystemState().
// The human readable table is written to pcWriteBuffer
void vTaskGetRunTimeStats( char *pcWriteBuffer )
{
TaskStatus_t *pxTaskStatusArray;
volatile UBaseType_t uxArraySize, x;
configRUN_TIME_COUNTER_TYPE ulTotalRunTime, ulStatsAsPercentage;
// Make sure the write buffer does not contain a string.
pcWriteBuffer = 0x00;
// Take a snapshot of the number of tasks in case it changes while this
// function is executing.
uxArraySize = uxTaskGetNumberOfTasks();
// Allocate a TaskStatus_t structure for each task. An array could be
// allocated statically at compile time.
pxTaskStatusArray = pvPortMalloc( uxArraySize * sizeof( TaskStatus_t ) );
if( pxTaskStatusArray != NULL )
{
// Generate raw status information about each task.
uxArraySize = uxTaskGetSystemState( pxTaskStatusArray, uxArraySize, &ulTotalRunTime );
// For percentage calculations.
ulTotalRunTime /= 100UL;
// Avoid divide by zero errors.
if( ulTotalRunTime > 0 )
{
// For each populated position in the pxTaskStatusArray array,
// format the raw data as human readable ASCII data
for( x = 0; x < uxArraySize; x++ )
{
// What percentage of the total run time has the task used?
// This will always be rounded down to the nearest integer.
// ulTotalRunTimeDiv100 has already been divided by 100.
ulStatsAsPercentage = pxTaskStatusArray[ x ].ulRunTimeCounter / ulTotalRunTime;
if( ulStatsAsPercentage > 0UL )
{
sprintf( pcWriteBuffer, "%s\t\t%lu\t\t%lu%%\r\n", pxTaskStatusArray[ x ].pcTaskName, pxTaskStatusArray[ x ].ulRunTimeCounter, ulStatsAsPercentage );
}
else
{
// If the percentage is zero here then the task has
// consumed less than 1% of the total run time.
sprintf( pcWriteBuffer, "%s\t\t%lu\t\t<1%%\r\n", pxTaskStatusArray[ x ].pcTaskName, pxTaskStatusArray[ x ].ulRunTimeCounter );
}
pcWriteBuffer += strlen( ( char * ) pcWriteBuffer );
}
}
// The array is no longer needed, free the memory it consumes.
vPortFree( pxTaskStatusArray );
}
}
#define configRUN_TIME_COUNTER_TYPE
Definition FreeRTOS.h:1006
void vPortFree(void *pv) PRIVILEGED_FUNCTION
Definition heap_4.c:307
void * pvPortMalloc(size_t xSize) PRIVILEGED_FUNCTION
configRUN_TIME_COUNTER_TYPE ulRunTimeCounter
Definition task.h:167
void vTaskGetRunTimeStats(char *pcWriteBuffer) PRIVILEGED_FUNCTION
UBaseType_t uxTaskGetNumberOfTasks(void) PRIVILEGED_FUNCTION
Definition tasks.c:2345
UBaseType_t uxTaskGetSystemState(TaskStatus_t *const pxTaskStatusArray, const UBaseType_t uxArraySize, configRUN_TIME_COUNTER_TYPE *const pulTotalRunTime) PRIVILEGED_FUNCTION
configUSE_TRACE_FACILITY must be defined as 1 in FreeRTOSConfig.h for uxTaskGetSystemState() to be av...
struct xTASK_STATUS TaskStatus_t

References configRUN_TIME_COUNTER_TYPE, and PRIVILEGED_FUNCTION.

Referenced by osThreadEnumerate().

◆ uxTaskGetTaskNumber()

UBaseType_t uxTaskGetTaskNumber ( TaskHandle_t xTask)

References PRIVILEGED_FUNCTION.

◆ uxTaskPriorityGet()

UBaseType_t uxTaskPriorityGet ( const TaskHandle_t xTask)

References PRIVILEGED_FUNCTION.

Referenced by osThreadGetPriority().

◆ uxTaskPriorityGetFromISR()

UBaseType_t uxTaskPriorityGetFromISR ( const TaskHandle_t xTask)

task.

h

UBaseType_t uxTaskPriorityGetFromISR(const TaskHandle_t xTask) PRIVILEGED_FUNCTION
task.

A version of uxTaskPriorityGet() that can be used from an ISR.

References PRIVILEGED_FUNCTION.

◆ uxTaskResetEventItemValue()

TickType_t uxTaskResetEventItemValue ( void )

◆ vTaskAllocateMPURegions()

void vTaskAllocateMPURegions ( TaskHandle_t xTask,
const MemoryRegion_t *const pxRegions )

References PRIVILEGED_FUNCTION.

◆ vTaskDelay()

void vTaskDelay ( const TickType_t xTicksToDelay)

References PRIVILEGED_FUNCTION.

Referenced by osDelay().

◆ vTaskDelete()

void vTaskDelete ( TaskHandle_t xTaskToDelete)

References PRIVILEGED_FUNCTION.

Referenced by osThreadExit(), and osThreadTerminate().

◆ vTaskEndScheduler()

void vTaskEndScheduler ( void )

Definition at line 2092 of file tasks.c.

References pdFALSE, portDISABLE_INTERRUPTS, vPortEndScheduler(), and xSchedulerRunning.

◆ vTaskGenericNotifyGiveFromISR()

void vTaskGenericNotifyGiveFromISR ( TaskHandle_t xTaskToNotify,
UBaseType_t uxIndexToNotify,
BaseType_t * pxHigherPriorityTaskWoken )

References PRIVILEGED_FUNCTION.

◆ vTaskGetInfo()

void vTaskGetInfo ( TaskHandle_t xTask,
TaskStatus_t * pxTaskStatus,
BaseType_t xGetFreeStackSpace,
eTaskState eState )

References PRIVILEGED_FUNCTION.

◆ vTaskGetRunTimeStats()

void vTaskGetRunTimeStats ( char * pcWriteBuffer)

References PRIVILEGED_FUNCTION.

◆ vTaskInternalSetTimeOutState()

void vTaskInternalSetTimeOutState ( TimeOut_t *const pxTimeOut)

◆ vTaskList()

void vTaskList ( char * pcWriteBuffer)

References PRIVILEGED_FUNCTION.

◆ vTaskMissedYield()

void vTaskMissedYield ( void )

Definition at line 3431 of file tasks.c.

References pdTRUE, and xYieldPending.

Referenced by prvUnlockQueue().

◆ vTaskPlaceOnEventList()

void vTaskPlaceOnEventList ( List_t *const pxEventList,
const TickType_t xTicksToWait )

◆ vTaskPlaceOnEventListRestricted()

void vTaskPlaceOnEventListRestricted ( List_t *const pxEventList,
TickType_t xTicksToWait,
const BaseType_t xWaitIndefinitely )

◆ vTaskPlaceOnUnorderedEventList()

void vTaskPlaceOnUnorderedEventList ( List_t * pxEventList,
const TickType_t xItemValue,
const TickType_t xTicksToWait )

◆ vTaskPriorityDisinheritAfterTimeout()

void vTaskPriorityDisinheritAfterTimeout ( TaskHandle_t const pxMutexHolder,
UBaseType_t uxHighestPriorityWaitingTask )

References PRIVILEGED_FUNCTION.

Referenced by xQueueSemaphoreTake().

◆ vTaskPrioritySet()

void vTaskPrioritySet ( TaskHandle_t xTask,
UBaseType_t uxNewPriority )

References PRIVILEGED_FUNCTION.

Referenced by osThreadSetPriority().

◆ vTaskRemoveFromUnorderedEventList()

◆ vTaskResume()

void vTaskResume ( TaskHandle_t xTaskToResume)

References PRIVILEGED_FUNCTION.

Referenced by osThreadResume().

◆ vTaskSetTaskNumber()

void vTaskSetTaskNumber ( TaskHandle_t xTask,
const UBaseType_t uxHandle )

References PRIVILEGED_FUNCTION.

◆ vTaskSetTimeOutState()

void vTaskSetTimeOutState ( TimeOut_t *const pxTimeOut)

◆ vTaskStartScheduler()

◆ vTaskStepTick()

void vTaskStepTick ( TickType_t xTicksToJump)

References PRIVILEGED_FUNCTION.

◆ vTaskSuspend()

void vTaskSuspend ( TaskHandle_t xTaskToSuspend)

References PRIVILEGED_FUNCTION.

Referenced by osThreadSuspend().

◆ vTaskSuspendAll()

◆ vTaskSwitchContext()

◆ xTaskAbortDelay()

BaseType_t xTaskAbortDelay ( TaskHandle_t xTask)

References PRIVILEGED_FUNCTION.

◆ xTaskCallApplicationTaskHook()

BaseType_t xTaskCallApplicationTaskHook ( TaskHandle_t xTask,
void * pvParameter )

task.h

long BaseType_t
Definition portmacro.h:59
BaseType_t xTaskCallApplicationTaskHook(TaskHandle_t xTask, void *pvParameter) PRIVILEGED_FUNCTION
task.h

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. The return value is the value returned by the task hook function registered by the user.

References PRIVILEGED_FUNCTION.

◆ xTaskCatchUpTicks()

BaseType_t xTaskCatchUpTicks ( TickType_t xTicksToCatchUp)

◆ xTaskCheckForTimeOut()

◆ xTaskDelayUntil()

BaseType_t xTaskDelayUntil ( TickType_t *const pxPreviousWakeTime,
const TickType_t xTimeIncrement )

References PRIVILEGED_FUNCTION.

Referenced by osDelayUntil().

◆ xTaskGenericNotify()

BaseType_t xTaskGenericNotify ( TaskHandle_t xTaskToNotify,
UBaseType_t uxIndexToNotify,
uint32_t ulValue,
eNotifyAction eAction,
uint32_t * pulPreviousNotificationValue )

References PRIVILEGED_FUNCTION.

◆ xTaskGenericNotifyFromISR()

BaseType_t xTaskGenericNotifyFromISR ( TaskHandle_t xTaskToNotify,
UBaseType_t uxIndexToNotify,
uint32_t ulValue,
eNotifyAction eAction,
uint32_t * pulPreviousNotificationValue,
BaseType_t * pxHigherPriorityTaskWoken )

References PRIVILEGED_FUNCTION.

◆ xTaskGenericNotifyStateClear()

BaseType_t xTaskGenericNotifyStateClear ( TaskHandle_t xTask,
UBaseType_t uxIndexToClear )

References PRIVILEGED_FUNCTION.

◆ xTaskGenericNotifyWait()

BaseType_t xTaskGenericNotifyWait ( UBaseType_t uxIndexToWaitOn,
uint32_t ulBitsToClearOnEntry,
uint32_t ulBitsToClearOnExit,
uint32_t * pulNotificationValue,
TickType_t xTicksToWait )

References PRIVILEGED_FUNCTION.

◆ xTaskGetCurrentTaskHandle()

TaskHandle_t xTaskGetCurrentTaskHandle ( void )

◆ xTaskGetHandle()

TaskHandle_t xTaskGetHandle ( const char * pcNameToQuery)

References PRIVILEGED_FUNCTION.

◆ xTaskGetIdleTaskHandle()

TaskHandle_t 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.

References PRIVILEGED_FUNCTION.

◆ xTaskGetSchedulerState()

◆ xTaskGetTickCount()

TickType_t xTaskGetTickCount ( void )

◆ xTaskGetTickCountFromISR()

TickType_t xTaskGetTickCountFromISR ( void )

◆ xTaskIncrementTick()

◆ xTaskPriorityDisinherit()

BaseType_t xTaskPriorityDisinherit ( TaskHandle_t const pxMutexHolder)

References PRIVILEGED_FUNCTION.

Referenced by prvCopyDataToQueue().

◆ xTaskPriorityInherit()

BaseType_t xTaskPriorityInherit ( TaskHandle_t const pxMutexHolder)

References PRIVILEGED_FUNCTION.

Referenced by xQueueSemaphoreTake().

◆ xTaskRemoveFromEventList()

◆ xTaskResumeAll()

◆ xTaskResumeFromISR()

BaseType_t xTaskResumeFromISR ( TaskHandle_t xTaskToResume)

References PRIVILEGED_FUNCTION.