Microchip® Advanced Software Framework

freertos-7.0.0/source/include/task.h File Reference
#include "portable.h"
#include "list.h"

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
 

Functions

unsigned long ulTaskEndTrace (void) PRIVILEGED_FUNCTION
 
unsigned portBASE_TYPE uxTaskGetNumberOfTasks (void) PRIVILEGED_FUNCTION
 
unsigned portBASE_TYPE uxTaskGetStackHighWaterMark (xTaskHandle xTask) PRIVILEGED_FUNCTION
 task.h More...
 
unsigned portBASE_TYPE uxTaskPriorityGet (xTaskHandle pxTask) PRIVILEGED_FUNCTION
 
void vTaskAllocateMPURegions (xTaskHandle xTask, const xMemoryRegion *const pxRegions) PRIVILEGED_FUNCTION
 
void vTaskCleanUpResources (void) PRIVILEGED_FUNCTION
 
void vTaskDelay (portTickType xTicksToDelay) PRIVILEGED_FUNCTION
 
void vTaskDelayUntil (portTickType *const pxPreviousWakeTime, portTickType xTimeIncrement) PRIVILEGED_FUNCTION
 
void vTaskDelete (xTaskHandle pxTaskToDelete) PRIVILEGED_FUNCTION
 
void vTaskEndScheduler (void) PRIVILEGED_FUNCTION
 
void vTaskGetRunTimeStats (signed char *pcWriteBuffer) PRIVILEGED_FUNCTION
 
void vTaskIncrementTick (void) PRIVILEGED_FUNCTION
 
void vTaskList (signed char *pcWriteBuffer) PRIVILEGED_FUNCTION
 
void vTaskMissedYield (void) PRIVILEGED_FUNCTION
 
void vTaskPlaceOnEventList (const xList *const pxEventList, portTickType xTicksToWait) PRIVILEGED_FUNCTION
 
void vTaskPlaceOnEventListRestricted (const xList *const pxEventList, portTickType xTicksToWait) PRIVILEGED_FUNCTION
 
void vTaskPriorityDisinherit (xTaskHandle *const pxMutexHolder) PRIVILEGED_FUNCTION
 
void vTaskPriorityInherit (xTaskHandle *const pxMutexHolder) PRIVILEGED_FUNCTION
 
void vTaskPrioritySet (xTaskHandle pxTask, unsigned portBASE_TYPE uxNewPriority) PRIVILEGED_FUNCTION
 
void vTaskResume (xTaskHandle pxTaskToResume) PRIVILEGED_FUNCTION
 
void vTaskSetTimeOutState (xTimeOutType *const pxTimeOut) PRIVILEGED_FUNCTION
 
void vTaskStartScheduler (void) PRIVILEGED_FUNCTION
 
void vTaskStartTrace (signed char *pcBuffer, unsigned long ulBufferSize) PRIVILEGED_FUNCTION
 
void vTaskSuspend (xTaskHandle pxTaskToSuspend) PRIVILEGED_FUNCTION
 
void vTaskSuspendAll (void) PRIVILEGED_FUNCTION
 
void vTaskSwitchContext (void) PRIVILEGED_FUNCTION
 
portBASE_TYPE xTaskCallApplicationTaskHook (xTaskHandle xTask, void *pvParameter) PRIVILEGED_FUNCTION
 task.h More...
 
portBASE_TYPE xTaskCheckForTimeOut (xTimeOutType *const pxTimeOut, portTickType *const pxTicksToWait) PRIVILEGED_FUNCTION
 
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) PRIVILEGED_FUNCTION
 
xTaskHandle xTaskGetCurrentTaskHandle (void) PRIVILEGED_FUNCTION
 
portBASE_TYPE xTaskGetSchedulerState (void) PRIVILEGED_FUNCTION
 
portTickType xTaskGetTickCount (void) PRIVILEGED_FUNCTION
 
portTickType xTaskGetTickCountFromISR (void) PRIVILEGED_FUNCTION
 
signed portBASE_TYPE xTaskIsTaskSuspended (xTaskHandle xTask) PRIVILEGED_FUNCTION
 task. More...
 
signed portBASE_TYPE xTaskRemoveFromEventList (const xList *const pxEventList) PRIVILEGED_FUNCTION
 
signed portBASE_TYPE xTaskResumeAll (void) PRIVILEGED_FUNCTION
 
portBASE_TYPE xTaskResumeFromISR (xTaskHandle pxTaskToResume) PRIVILEGED_FUNCTION
 

#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) )

typedef struct xMEMORY_REGION xMemoryRegion
typedef void* xTaskHandle
typedef struct xTIME_OUT xTimeOutType

unsigned long ulTaskEndTrace ( void  )
unsigned portBASE_TYPE uxTaskGetNumberOfTasks ( void  )
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.

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 bytes) since the task referenced by xTask was created.
unsigned portBASE_TYPE uxTaskPriorityGet ( xTaskHandle  pxTask)
void vTaskAllocateMPURegions ( xTaskHandle  xTask,
const xMemoryRegion *const  pxRegions 
)
void vTaskCleanUpResources ( void  )
void vTaskDelay ( portTickType  xTicksToDelay)
void vTaskDelayUntil ( portTickType *const  pxPreviousWakeTime,
portTickType  xTimeIncrement 
)
void vTaskDelete ( xTaskHandle  pxTaskToDelete)
void vTaskEndScheduler ( void  )
void vTaskGetRunTimeStats ( signed char *  pcWriteBuffer)
void vTaskList ( signed char *  pcWriteBuffer)
void vTaskMissedYield ( void  )
void vTaskPlaceOnEventListRestricted ( const xList *const  pxEventList,
portTickType  xTicksToWait 
)
void vTaskPriorityDisinherit ( xTaskHandle *const  pxMutexHolder)
void vTaskPriorityInherit ( xTaskHandle *const  pxMutexHolder)
void vTaskPrioritySet ( xTaskHandle  pxTask,
unsigned portBASE_TYPE  uxNewPriority 
)
void vTaskResume ( xTaskHandle  pxTaskToResume)
void vTaskSetTimeOutState ( xTimeOutType *const  pxTimeOut)
void vTaskStartScheduler ( void  )
void vTaskStartTrace ( signed char *  pcBuffer,
unsigned long  ulBufferSize 
)
void vTaskSuspend ( xTaskHandle  pxTaskToSuspend)
void vTaskSuspendAll ( void  )
void vTaskSwitchContext ( void  )
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.

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  )
portBASE_TYPE xTaskGetSchedulerState ( void  )
portTickType xTaskGetTickCount ( void  )
portTickType xTaskGetTickCountFromISR ( void  )
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.

signed portBASE_TYPE xTaskRemoveFromEventList ( const xList *const  pxEventList)
signed portBASE_TYPE xTaskResumeAll ( void  )
portBASE_TYPE xTaskResumeFromISR ( xTaskHandle  pxTaskToResume)