Atmel Software Framework

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)
 
void vApplicationTickHook (void)
 
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 ) )
void vListInsertEnd(xList *pxList, xListItem *pxNewListItem)
Definition: list.c:96
static PRIVILEGED_DATA xList pxReadyTasksLists[configMAX_PRIORITIES]
Definition: tasks.c:140
static PRIVILEGED_DATA volatile unsigned portBASE_TYPE uxTopReadyPriority
Definition: tasks.c:164
Definition: list.h:119

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 void prvAddCurrentTaskToDelayedList ( portTickType  xTimeToWake)
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 
)
void vTaskEndScheduler ( void  )
void vTaskMissedYield ( void  )

References pdTRUE, and xMissedYield.

Referenced by prvUnlockQueue().

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

PRIVILEGED_DATA xList* volatile pxOverflowDelayedTaskList
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