Microchip® Advanced Software Framework

freertos-7.3.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 portRESET_READY_PRIORITY(uxPriority, uxTopReadyPriority)
 
#define prvAddTaskToReadyQueue(pxTCB)
 
#define prvCheckDelayedTasks()
 
#define prvGetTCBFromHandle(pxHandle)   ( ( ( pxHandle ) == NULL ) ? ( tskTCB * ) pxCurrentTCB : ( tskTCB * ) ( pxHandle ) )
 
#define taskRECORD_READY_PRIORITY(uxPriority)
 
#define taskRESET_READY_PRIORITY(uxPriority)
 
#define taskSELECT_HIGHEST_PRIORITY_TASK()
 
#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' )
 

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)
 
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 ) 0U
 
static PRIVILEGED_DATA
volatile unsigned
portBASE_TYPE 
uxMissedTicks = ( unsigned portBASE_TYPE ) 0U
 
static PRIVILEGED_DATA
volatile unsigned
portBASE_TYPE 
uxSchedulerSuspended = ( unsigned portBASE_TYPE ) pdFALSE
 
static PRIVILEGED_DATA
unsigned portBASE_TYPE 
uxTaskNumber = ( unsigned portBASE_TYPE ) 0U
 
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
volatile 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 ) 0U
 

#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
#define portRESET_READY_PRIORITY (   uxPriority,
  uxTopReadyPriority 
)

Referenced by vTaskPlaceOnEventList().

#define prvAddTaskToReadyQueue (   pxTCB)
Value:
taskRECORD_READY_PRIORITY( ( pxTCB )->uxPriority ); \
vListInsertEnd( ( xList * ) &( pxReadyTasksLists[ ( pxTCB )->uxPriority ] ), &( ( pxTCB )->xGenericListItem ) )
#define taskRECORD_READY_PRIORITY(uxPriority)
Definition: freertos-7.3.0/source/tasks.c:224
void vListInsertEnd(xList *pxList, xListItem *pxNewListItem)
Definition: freertos-7.3.0/source/list.c:105
#define traceMOVED_TASK_TO_READY_STATE(pxTCB)
Definition: freertos-7.3.0/source/include/FreeRTOS.h:348
Definition: freertos-7.3.0/source/include/list.h:128
static PRIVILEGED_DATA xList pxReadyTasksLists[configMAX_PRIORITIES]
Definition: freertos-7.3.0/source/tasks.c:151

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

#define prvCheckDelayedTasks ( )

Referenced by vTaskIncrementTick().

#define prvGetTCBFromHandle (   pxHandle)    ( ( ( pxHandle ) == NULL ) ? ( tskTCB * ) pxCurrentTCB : ( tskTCB * ) ( pxHandle ) )
#define taskRECORD_READY_PRIORITY (   uxPriority)
Value:
{ \
if( ( uxPriority ) > uxTopReadyPriority ) \
{ \
uxTopReadyPriority = ( uxPriority ); \
} \
} /* taskRECORD_READY_PRIORITY */
static PRIVILEGED_DATA volatile unsigned portBASE_TYPE uxTopReadyPriority
Definition: freertos-7.3.0/source/tasks.c:181
if(memp!=NULL)
Definition: src/core/memp.c:407
#define taskRESET_READY_PRIORITY (   uxPriority)
#define taskSELECT_HIGHEST_PRIORITY_TASK ( )
Value:
{ \
/* Find the highest priority queue that contains ready tasks. */ \
{ \
} \
\
/* listGET_OWNER_OF_NEXT_ENTRY indexes through the list, so the tasks of \
the same priority get an equal share of the processor time. */ \
} /* taskSELECT_HIGHEST_PRIORITY_TASK */
#define configASSERT(x)
Definition: freertos-7.3.0/source/include/FreeRTOS.h:221
PRIVILEGED_DATA tskTCB *volatile pxCurrentTCB
Definition: freertos-7.3.0/source/tasks.c:148
#define listGET_OWNER_OF_NEXT_ENTRY(pxTCB, pxList)
Definition: freertos-7.3.0/source/include/list.h:214
#define listLIST_IS_EMPTY(pxList)
Definition: freertos-7.3.0/source/include/list.h:188
static PRIVILEGED_DATA volatile unsigned portBASE_TYPE uxTopReadyPriority
Definition: freertos-7.3.0/source/tasks.c:181
static PRIVILEGED_DATA xList pxReadyTasksLists[configMAX_PRIORITIES]
Definition: freertos-7.3.0/source/tasks.c:151

Referenced by vTaskSwitchContext().

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

typedef struct tskTaskControlBlock tskTCB

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 
)
void vApplicationTickHook ( void  )

This function is called by FreeRTOS each tick.

Referenced by vTaskIncrementTick(), and xTaskIncrementTick().

void vTaskEndScheduler ( void  )
void vTaskIncrementTick ( void  )

Referenced by xTaskResumeAll().

void vTaskMissedYield ( void  )

Referenced by prvUnlockQueue().

void vTaskPlaceOnEventList ( const xList *const  pxEventList,
portTickType  xTicksToWait 
)
void vTaskSetTimeOutState ( xTimeOutType *const  pxTimeOut)
void vTaskStartScheduler ( void  )

Referenced by main().

void vTaskSwitchContext ( void  )
portBASE_TYPE xTaskCheckForTimeOut ( xTimeOutType *const  pxTimeOut,
portTickType *const  pxTicksToWait 
)
portTickType xTaskGetTickCountFromISR ( void  )

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

Referenced by prvInitialiseTaskLists().

PRIVILEGED_DATA volatile unsigned portBASE_TYPE uxTopReadyPriority = tskIDLE_PRIORITY
static

Referenced by vTaskPlaceOnEventList().

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 volatile 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