XDK API  3.6.0
Documentation
Data Structures | Macros | Typedefs | Functions | Variables
tasks.c File Reference
#include <stdlib.h>
#include <string.h>
#include "FreeRTOS.h"
#include "task.h"
#include "timers.h"
#include "stack_macros.h"
+ Include dependency graph for tasks.c:

Data Structures

struct  tskTaskControlBlock
 

Macros

#define configIDLE_TASK_NAME   "IDLE"
 
#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
 
#define portRESET_READY_PRIORITY(uxPriority, uxTopReadyPriority)
 
#define prvAddTaskToReadyList(pxTCB)
 
#define prvGetTCBFromHandle(pxHandle)   ( ( ( pxHandle ) == NULL ) ? ( TCB_t * ) pxCurrentTCB : ( TCB_t * ) ( pxHandle ) )
 
#define taskEVENT_LIST_ITEM_VALUE_IN_USE   0x80000000UL
 
#define taskNOT_WAITING_NOTIFICATION   ( ( uint8_t ) 0 )
 
#define taskNOTIFICATION_RECEIVED   ( ( uint8_t ) 2 )
 
#define taskRECORD_READY_PRIORITY(uxPriority)
 
#define taskRESET_READY_PRIORITY(uxPriority)
 
#define taskSELECT_HIGHEST_PRIORITY_TASK()
 
#define taskSWITCH_DELAYED_LISTS()
 
#define taskWAITING_NOTIFICATION   ( ( uint8_t ) 1 )
 
#define taskYIELD_IF_USING_PREEMPTION()
 
#define tskBLOCKED_CHAR   ( 'B' )
 
#define tskDELETED_CHAR   ( 'D' )
 
#define tskDYNAMICALLY_ALLOCATED_STACK_AND_TCB   ( ( uint8_t ) 0 )
 
#define tskREADY_CHAR   ( 'R' )
 
#define tskRUNNING_CHAR   ( 'X' )
 
#define tskSET_NEW_STACKS_TO_KNOWN_VALUE   0
 
#define tskSTACK_FILL_BYTE   ( 0xa5U )
 
#define tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE   ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
 
#define tskSTATICALLY_ALLOCATED_STACK_AND_TCB   ( ( uint8_t ) 2 )
 
#define tskSTATICALLY_ALLOCATED_STACK_ONLY   ( ( uint8_t ) 1 )
 
#define tskSUSPENDED_CHAR   ( 'S' )
 

Typedefs

typedef tskTCB TCB_t
 
typedef struct tskTaskControlBlock tskTCB
 

Functions

char * pcTaskGetName (TaskHandle_t xTaskToQuery)
 
static portTASK_FUNCTION (prvIdleTask, pvParameters)
 
static void prvAddCurrentTaskToDelayedList (TickType_t xTicksToWait, const BaseType_t xCanBlockIndefinitely)
 
static void prvAddNewTaskToReadyList (TCB_t *pxNewTCB)
 
static void prvCheckTasksWaitingTermination (void)
 
static void prvInitialiseTaskLists (static void prvCheckTasksWaitingTermination void)
 
static void prvInitialiseTaskLists (void)
 
static void prvResetNextTaskUnblockTime (void)
 
UBaseType_t uxTaskGetNumberOfTasks (void)
 
TickType_t uxTaskResetEventItemValue (void)
 
void vTaskEndScheduler (void)
 
void vTaskInternalSetTimeOutState (TimeOut_t *const pxTimeOut)
 
void vTaskMissedYield (void)
 
void vTaskPlaceOnEventList (List_t *const pxEventList, const TickType_t xTicksToWait)
 
void vTaskPlaceOnUnorderedEventList (List_t *pxEventList, const TickType_t xItemValue, const TickType_t xTicksToWait)
 
void vTaskRemoveFromUnorderedEventList (ListItem_t *pxEventListItem, const TickType_t xItemValue)
 
void vTaskSetTimeOutState (TimeOut_t *const pxTimeOut)
 
void vTaskStartScheduler (void)
 
void vTaskSuspendAll (void)
 
void vTaskSwitchContext (void)
 
BaseType_t xTaskCheckForTimeOut (TimeOut_t *const pxTimeOut, TickType_t *const pxTicksToWait)
 
TickType_t xTaskGetIdleTickCount (void)
 
TickType_t xTaskGetIdleTickCountFromISR (void)
 
TickType_t xTaskGetTickCount (void)
 
TickType_t xTaskGetTickCountFromISR (void)
 
BaseType_t xTaskIncrementTick (void)
 
BaseType_t xTaskRemoveFromEventList (const List_t *const pxEventList)
 
BaseType_t xTaskResumeAll (void)
 

Variables

PRIVILEGED_DATA TCB_t *volatile pxCurrentTCB = NULL
 
static PRIVILEGED_DATA List_t
*volatile 
pxDelayedTaskList
 
static PRIVILEGED_DATA List_t
*volatile 
pxOverflowDelayedTaskList
 
static PRIVILEGED_DATA List_t pxReadyTasksLists [configMAX_PRIORITIES]
 
static PRIVILEGED_DATA
volatile UBaseType_t 
uxCurrentNumberOfTasks = ( UBaseType_t ) 0U
 
static PRIVILEGED_DATA
volatile UBaseType_t 
uxPendedTicks = ( UBaseType_t ) 0U
 
static PRIVILEGED_DATA
volatile UBaseType_t 
uxSchedulerSuspended = ( UBaseType_t ) pdFALSE
 
static PRIVILEGED_DATA UBaseType_t uxTaskNumber = ( UBaseType_t ) 0U
 
static PRIVILEGED_DATA
volatile UBaseType_t 
uxTopReadyPriority = tskIDLE_PRIORITY
 
static PRIVILEGED_DATA List_t xDelayedTaskList1
 
static PRIVILEGED_DATA List_t xDelayedTaskList2
 
static PRIVILEGED_DATA TaskHandle_t xIdleTaskHandle = NULL
 
static PRIVILEGED_DATA
volatile TickType_t 
xIdleTickCount = ( TickType_t ) configINITIAL_TICK_COUNT
 
static PRIVILEGED_DATA
volatile TickType_t 
xNextTaskUnblockTime = ( TickType_t ) 0U
 
static PRIVILEGED_DATA
volatile BaseType_t 
xNumOfOverflows = ( BaseType_t ) 0
 
static PRIVILEGED_DATA List_t xPendingReadyList
 
static PRIVILEGED_DATA
volatile BaseType_t 
xSchedulerRunning = pdFALSE
 
static PRIVILEGED_DATA
volatile TickType_t 
xTickCount = ( TickType_t ) configINITIAL_TICK_COUNT
 
static PRIVILEGED_DATA
volatile BaseType_t 
xYieldPending = pdFALSE
 

Macro Definition Documentation

#define configIDLE_TASK_NAME   "IDLE"
#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
#define portRESET_READY_PRIORITY (   uxPriority,
  uxTopReadyPriority 
)
#define prvAddTaskToReadyList (   pxTCB)
Value:
taskRECORD_READY_PRIORITY( ( pxTCB )->uxPriority ); \
vListInsertEnd( &( pxReadyTasksLists[ ( pxTCB )->uxPriority ] ), &( ( pxTCB )->xStateListItem ) ); \
static PRIVILEGED_DATA List_t pxReadyTasksLists[configMAX_PRIORITIES]
Definition: tasks.c:355
#define traceMOVED_TASK_TO_READY_STATE(pxTCB)
Definition: FreeRTOS.h:388
#define taskRECORD_READY_PRIORITY(uxPriority)
Definition: tasks.c:140
#define tracePOST_MOVED_TASK_TO_READY_STATE(pxTCB)
Definition: FreeRTOS.h:392
#define prvGetTCBFromHandle (   pxHandle)    ( ( ( pxHandle ) == NULL ) ? ( TCB_t * ) pxCurrentTCB : ( TCB_t * ) ( pxHandle ) )
#define taskEVENT_LIST_ITEM_VALUE_IN_USE   0x80000000UL
#define taskNOT_WAITING_NOTIFICATION   ( ( uint8_t ) 0 )
#define taskNOTIFICATION_RECEIVED   ( ( uint8_t ) 2 )
#define taskRECORD_READY_PRIORITY (   uxPriority)
Value:
{ \
if( ( uxPriority ) > uxTopReadyPriority ) \
{ \
uxTopReadyPriority = ( uxPriority ); \
} \
} /* taskRECORD_READY_PRIORITY */
static PRIVILEGED_DATA volatile UBaseType_t uxTopReadyPriority
Definition: tasks.c:385
#define taskRESET_READY_PRIORITY (   uxPriority)
#define taskSELECT_HIGHEST_PRIORITY_TASK ( )
Value:
{ \
UBaseType_t uxTopPriority = uxTopReadyPriority; \
\
/* Find the highest priority queue that contains ready tasks. */ \
while( listLIST_IS_EMPTY( &( pxReadyTasksLists[ uxTopPriority ] ) ) ) \
{ \
configASSERT( uxTopPriority ); \
--uxTopPriority; \
} \
\
/* listGET_OWNER_OF_NEXT_ENTRY indexes through the list, so the tasks of \
the same priority get an equal share of the processor time. */ \
listGET_OWNER_OF_NEXT_ENTRY( pxCurrentTCB, &( pxReadyTasksLists[ uxTopPriority ] ) ); \
uxTopReadyPriority = uxTopPriority; \
} /* taskSELECT_HIGHEST_PRIORITY_TASK */
static PRIVILEGED_DATA List_t pxReadyTasksLists[configMAX_PRIORITIES]
Definition: tasks.c:355
#define configASSERT(expression)
Definition: FreeRTOSConfig.h:53
PRIVILEGED_DATA TCB_t *volatile pxCurrentTCB
Definition: tasks.c:352
unsigned long UBaseType_t
Definition: portmacro.h:57
static PRIVILEGED_DATA volatile UBaseType_t uxTopReadyPriority
Definition: tasks.c:385
#define taskSWITCH_DELAYED_LISTS ( )
Value:
{ \
List_t *pxTemp; \
\
/* The delayed tasks list should be empty when the lists are switched. */ \
configASSERT( ( listLIST_IS_EMPTY( pxDelayedTaskList ) ) ); \
\
pxTemp = pxDelayedTaskList; \
}
#define configASSERT(expression)
Definition: FreeRTOSConfig.h:53
static PRIVILEGED_DATA volatile BaseType_t xNumOfOverflows
Definition: tasks.c:389
static void prvResetNextTaskUnblockTime(void)
Definition: tasks.c:3801
static PRIVILEGED_DATA List_t *volatile pxDelayedTaskList
Definition: tasks.c:358
static PRIVILEGED_DATA List_t *volatile pxOverflowDelayedTaskList
Definition: tasks.c:359
#define taskWAITING_NOTIFICATION   ( ( uint8_t ) 1 )
#define taskYIELD_IF_USING_PREEMPTION ( )
#define tskBLOCKED_CHAR   ( 'B' )
#define tskDELETED_CHAR   ( 'D' )
#define tskDYNAMICALLY_ALLOCATED_STACK_AND_TCB   ( ( uint8_t ) 0 )
#define tskREADY_CHAR   ( 'R' )
#define tskRUNNING_CHAR   ( 'X' )
#define tskSET_NEW_STACKS_TO_KNOWN_VALUE   0
#define tskSTACK_FILL_BYTE   ( 0xa5U )
#define tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE   ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
#define tskSTATICALLY_ALLOCATED_STACK_AND_TCB   ( ( uint8_t ) 2 )
#define tskSTATICALLY_ALLOCATED_STACK_ONLY   ( ( uint8_t ) 1 )
#define tskSUSPENDED_CHAR   ( 'S' )

Typedef Documentation

typedef tskTCB TCB_t
typedef struct tskTaskControlBlock tskTCB

Function Documentation

char* pcTaskGetName ( TaskHandle_t  xTaskToQuery)
static portTASK_FUNCTION ( prvIdleTask  ,
pvParameters   
)
static

THIS IS THE RTOS IDLE TASK - WHICH IS CREATED AUTOMATICALLY WHEN THE SCHEDULER IS STARTED.

+ Here is the call graph for this function:

static void prvAddCurrentTaskToDelayedList ( TickType_t  xTicksToWait,
const BaseType_t  xCanBlockIndefinitely 
)
static

+ Here is the caller graph for this function:

static void prvAddNewTaskToReadyList ( TCB_t pxNewTCB)
static

+ Here is the call graph for this function:

static void prvCheckTasksWaitingTermination ( void  )
static

THIS FUNCTION IS CALLED FROM THE RTOS IDLE TASK

+ Here is the caller graph for this function:

static void prvInitialiseTaskLists ( static void prvCheckTasksWaitingTermination  void)
static

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.

+ Here is the caller graph for this function:

static void prvInitialiseTaskLists ( void  )
static
static void prvResetNextTaskUnblockTime ( void  )
static

+ Here is the caller graph for this function:

UBaseType_t uxTaskGetNumberOfTasks ( void  )
TickType_t uxTaskResetEventItemValue ( void  )
void vTaskEndScheduler ( void  )
void vTaskInternalSetTimeOutState ( TimeOut_t *const  pxTimeOut)

+ Here is the caller graph for this function:

void vTaskMissedYield ( void  )

+ Here is the caller graph for this function:

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

+ Here is the call graph for this function:

void vTaskRemoveFromUnorderedEventList ( ListItem_t *  pxEventListItem,
const TickType_t  xItemValue 
)
void vTaskSetTimeOutState ( TimeOut_t *const  pxTimeOut)
void vTaskStartScheduler ( void  )

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void vTaskSuspendAll ( void  )

+ Here is the caller graph for this function:

void vTaskSwitchContext ( void  )
BaseType_t xTaskCheckForTimeOut ( TimeOut_t *const  pxTimeOut,
TickType_t *const  pxTicksToWait 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TickType_t xTaskGetIdleTickCount ( void  )
TickType_t xTaskGetIdleTickCountFromISR ( void  )
TickType_t xTaskGetTickCount ( void  )

+ Here is the caller graph for this function:

TickType_t xTaskGetTickCountFromISR ( void  )
BaseType_t xTaskIncrementTick ( void  )

+ Here is the caller graph for this function:

BaseType_t xTaskRemoveFromEventList ( const List_t *const  pxEventList)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

BaseType_t xTaskResumeAll ( void  )

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

PRIVILEGED_DATA TCB_t* volatile pxCurrentTCB = NULL
PRIVILEGED_DATA List_t* volatile pxDelayedTaskList
static
PRIVILEGED_DATA List_t* volatile pxOverflowDelayedTaskList
static
PRIVILEGED_DATA List_t pxReadyTasksLists[configMAX_PRIORITIES]
static
PRIVILEGED_DATA volatile UBaseType_t uxCurrentNumberOfTasks = ( UBaseType_t ) 0U
static
PRIVILEGED_DATA volatile UBaseType_t uxPendedTicks = ( UBaseType_t ) 0U
static
PRIVILEGED_DATA volatile UBaseType_t uxSchedulerSuspended = ( UBaseType_t ) pdFALSE
static
PRIVILEGED_DATA UBaseType_t uxTaskNumber = ( UBaseType_t ) 0U
static
PRIVILEGED_DATA volatile UBaseType_t uxTopReadyPriority = tskIDLE_PRIORITY
static
PRIVILEGED_DATA List_t xDelayedTaskList1
static
PRIVILEGED_DATA List_t xDelayedTaskList2
static
PRIVILEGED_DATA TaskHandle_t xIdleTaskHandle = NULL
static
PRIVILEGED_DATA volatile TickType_t xIdleTickCount = ( TickType_t ) configINITIAL_TICK_COUNT
static
PRIVILEGED_DATA volatile TickType_t xNextTaskUnblockTime = ( TickType_t ) 0U
static
PRIVILEGED_DATA volatile BaseType_t xNumOfOverflows = ( BaseType_t ) 0
static
PRIVILEGED_DATA List_t xPendingReadyList
static
PRIVILEGED_DATA volatile BaseType_t xSchedulerRunning = pdFALSE
static
PRIVILEGED_DATA volatile TickType_t xTickCount = ( TickType_t ) configINITIAL_TICK_COUNT
static
PRIVILEGED_DATA volatile BaseType_t xYieldPending = pdFALSE
static

All rights reserved. The use is subject to the XDK SDK EULA by Bosch Connected Devices and Solutions GmbH.
This documentation file has been automatically generated on Thu Mar 14 2019 19:12:45 by doxygen 1.8.8