Microchip® Advanced Software Framework

freertos-7.0.0/source/tasks.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "include/FreeRTOS.h"
#include "include/task.h"
#include "include/timers.h"
#include "include/StackMacros.h"

Data Structures

struct  tskTaskControlBlock
 

Macros

#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
 
#define prvAddTaskToReadyQueue(pxTCB)
 
#define prvCheckDelayedTasks()
 
#define prvGetTCBFromHandle(pxHandle)   ( ( ( pxHandle ) == NULL ) ? ( tskTCB * ) pxCurrentTCB : ( tskTCB * ) ( pxHandle ) )
 
#define tskBLOCKED_CHAR   ( ( signed char ) 'B' )
 
#define tskDELETED_CHAR   ( ( signed char ) 'D' )
 
#define tskIDLE_STACK_SIZE   configMINIMAL_STACK_SIZE
 
#define tskREADY_CHAR   ( ( signed char ) 'R' )
 
#define tskSTACK_FILL_BYTE   ( 0xa5U )
 
#define tskSUSPENDED_CHAR   ( ( signed char ) 'S' )
 
#define vWriteTraceToBuffer()
 

Typedefs

typedef struct tskTaskControlBlock tskTCB
 

Functions

static portTASK_FUNCTION (prvIdleTask, pvParameters)
 
static void prvAddCurrentTaskToDelayedList (portTickType xTimeToWake)
 
static tskTCBprvAllocateTCBAndStack (unsigned short usStackDepth, portSTACK_TYPE *puxStackBuffer)
 
static void prvCheckTasksWaitingTermination (void)
 
static void prvInitialiseTaskLists (static void prvCheckTasksWaitingTermination void)
 
static void prvInitialiseTaskLists (void)
 
static void prvInitialiseTCBVariables (tskTCB *pxTCB, const signed char *const pcName, unsigned portBASE_TYPE uxPriority, const xMemoryRegion *const xRegions, unsigned short usStackDepth) PRIVILEGED_FUNCTION
 
unsigned portBASE_TYPE uxTaskGetNumberOfTasks (void)
 
void vApplicationStackOverflowHook (xTaskHandle *pxTask, signed char *pcTaskName)
 Called if stack overflow during execution. More...
 
void vApplicationTickHook (void)
 This function is called by FreeRTOS each tick. More...
 
void vTaskEndScheduler (void)
 
void vTaskIncrementTick (void)
 
void vTaskMissedYield (void)
 
void vTaskPlaceOnEventList (const xList *const pxEventList, portTickType xTicksToWait)
 
void vTaskSetTimeOutState (xTimeOutType *const pxTimeOut)
 
void vTaskStartScheduler (void)
 
void vTaskSuspendAll (void)
 
void vTaskSwitchContext (void)
 
portBASE_TYPE xTaskCheckForTimeOut (xTimeOutType *const pxTimeOut, portTickType *const pxTicksToWait)
 
portTickType xTaskGetTickCount (void)
 
portTickType xTaskGetTickCountFromISR (void)
 
signed portBASE_TYPE xTaskRemoveFromEventList (const xList *const pxEventList)
 
signed portBASE_TYPE xTaskResumeAll (void)
 

Variables

PRIVILEGED_DATA tskTCB *volatile pxCurrentTCB = NULL
 
static PRIVILEGED_DATA xList
*volatile 
pxDelayedTaskList
 
static PRIVILEGED_DATA xList
*volatile 
pxOverflowDelayedTaskList
 
static PRIVILEGED_DATA xList pxReadyTasksLists [configMAX_PRIORITIES]
 
static PRIVILEGED_DATA
volatile unsigned
portBASE_TYPE 
uxCurrentNumberOfTasks = ( unsigned portBASE_TYPE ) 0
 
static PRIVILEGED_DATA
volatile unsigned
portBASE_TYPE 
uxMissedTicks = ( unsigned portBASE_TYPE ) 0
 
static PRIVILEGED_DATA
volatile unsigned
portBASE_TYPE 
uxSchedulerSuspended = ( unsigned portBASE_TYPE ) pdFALSE
 
static PRIVILEGED_DATA
unsigned portBASE_TYPE 
uxTaskNumber = ( unsigned portBASE_TYPE ) 0
 
static PRIVILEGED_DATA
volatile unsigned
portBASE_TYPE 
uxTopReadyPriority = tskIDLE_PRIORITY
 
static PRIVILEGED_DATA
unsigned portBASE_TYPE 
uxTopUsedPriority = tskIDLE_PRIORITY
 
static PRIVILEGED_DATA xList xDelayedTaskList1
 
static PRIVILEGED_DATA xList xDelayedTaskList2
 
static PRIVILEGED_DATA
volatile portBASE_TYPE 
xMissedYield = ( portBASE_TYPE ) pdFALSE
 
static PRIVILEGED_DATA portTickType xNextTaskUnblockTime = ( portTickType ) portMAX_DELAY
 
static PRIVILEGED_DATA
volatile portBASE_TYPE 
xNumOfOverflows = ( portBASE_TYPE ) 0
 
static PRIVILEGED_DATA xList xPendingReadyList
 
static PRIVILEGED_DATA
volatile signed portBASE_TYPE 
xSchedulerRunning = pdFALSE
 
static PRIVILEGED_DATA
volatile portTickType 
xTickCount = ( portTickType ) 0
 

#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
#define prvAddTaskToReadyQueue (   pxTCB)
Value:
if( ( pxTCB )->uxPriority > uxTopReadyPriority ) \
{ \
uxTopReadyPriority = ( pxTCB )->uxPriority; \
} \
vListInsertEnd( ( xList * ) &( pxReadyTasksLists[ ( pxTCB )->uxPriority ] ), &( ( pxTCB )->xGenericListItem ) )
static PRIVILEGED_DATA xList pxReadyTasksLists[configMAX_PRIORITIES]
Definition: freertos-7.0.0/source/tasks.c:140
static PRIVILEGED_DATA volatile unsigned portBASE_TYPE uxTopReadyPriority
Definition: freertos-7.0.0/source/tasks.c:164
void vListInsertEnd(xList *pxList, xListItem *pxNewListItem)
Definition: freertos-7.3.0/source/list.c:105
Definition: freertos-7.3.0/source/include/list.h:128

Referenced by prvInitialiseTaskLists(), xTaskRemoveFromEventList(), and xTaskResumeAll().

#define prvCheckDelayedTasks ( )

Referenced by vTaskIncrementTick().

#define prvGetTCBFromHandle (   pxHandle)    ( ( ( pxHandle ) == NULL ) ? ( tskTCB * ) pxCurrentTCB : ( tskTCB * ) ( pxHandle ) )
#define tskBLOCKED_CHAR   ( ( signed char ) 'B' )
#define tskDELETED_CHAR   ( ( signed char ) 'D' )
#define tskIDLE_STACK_SIZE   configMINIMAL_STACK_SIZE

Referenced by vTaskStartScheduler().

#define tskREADY_CHAR   ( ( signed char ) 'R' )
#define tskSTACK_FILL_BYTE   ( 0xa5U )

Referenced by prvAllocateTCBAndStack().

#define tskSUSPENDED_CHAR   ( ( signed char ) 'S' )
#define vWriteTraceToBuffer ( )

Referenced by vTaskSwitchContext().

typedef struct tskTaskControlBlock tskTCB

static portTASK_FUNCTION ( prvIdleTask  ,
pvParameters   
)
static
static tskTCB* prvAllocateTCBAndStack ( unsigned short  usStackDepth,
portSTACK_TYPE *  puxStackBuffer 
)
static
static void prvInitialiseTCBVariables ( tskTCB pxTCB,
const signed char *const  pcName,
unsigned portBASE_TYPE  uxPriority,
const xMemoryRegion *const  xRegions,
unsigned short  usStackDepth 
)
static
unsigned portBASE_TYPE uxTaskGetNumberOfTasks ( void  )
void vApplicationStackOverflowHook ( xTaskHandle pxTask,
signed char *  pcTaskName 
)

Called if stack overflow during execution.

void vApplicationTickHook ( void  )

This function is called by FreeRTOS each tick.

void vTaskEndScheduler ( void  )
void vTaskMissedYield ( void  )

References pdTRUE, and xMissedYield.

void vTaskSetTimeOutState ( xTimeOutType *const  pxTimeOut)
void vTaskSuspendAll ( void  )

References uxSchedulerSuspended.

portTickType xTaskGetTickCount ( void  )

PRIVILEGED_DATA tskTCB* volatile pxCurrentTCB = NULL
PRIVILEGED_DATA xList* volatile pxOverflowDelayedTaskList
static
PRIVILEGED_DATA xList pxReadyTasksLists[configMAX_PRIORITIES]
static
PRIVILEGED_DATA volatile unsigned portBASE_TYPE uxCurrentNumberOfTasks = ( unsigned portBASE_TYPE ) 0
static
PRIVILEGED_DATA volatile unsigned portBASE_TYPE uxMissedTicks = ( unsigned portBASE_TYPE ) 0
static
PRIVILEGED_DATA volatile unsigned portBASE_TYPE uxSchedulerSuspended = ( unsigned portBASE_TYPE ) pdFALSE
static
PRIVILEGED_DATA unsigned portBASE_TYPE uxTaskNumber = ( unsigned portBASE_TYPE ) 0
static

Referenced by prvInitialiseTaskLists().

PRIVILEGED_DATA volatile unsigned portBASE_TYPE uxTopReadyPriority = tskIDLE_PRIORITY
static

Referenced by vTaskSwitchContext().

PRIVILEGED_DATA unsigned portBASE_TYPE uxTopUsedPriority = tskIDLE_PRIORITY
static

Referenced by prvInitialiseTaskLists().

PRIVILEGED_DATA xList xDelayedTaskList1
static

Referenced by prvInitialiseTaskLists().

PRIVILEGED_DATA xList xDelayedTaskList2
static

Referenced by prvInitialiseTaskLists().

PRIVILEGED_DATA volatile portBASE_TYPE xMissedYield = ( portBASE_TYPE ) pdFALSE
static
PRIVILEGED_DATA portTickType xNextTaskUnblockTime = ( portTickType ) portMAX_DELAY
static
PRIVILEGED_DATA volatile portBASE_TYPE xNumOfOverflows = ( portBASE_TYPE ) 0
static
PRIVILEGED_DATA volatile signed portBASE_TYPE xSchedulerRunning = pdFALSE
static