File tasks.c
FileList > FreeRTOS > src > tasks.c
Go to the source code of this file.
#include <stdlib.h>
#include <string.h>
#include "FreeRTOS.h"
#include "task.h"
#include "timers.h"
#include "stack_macros.h"
Classes
Public Types
Public Attributes
Public Static Attributes
Public Functions
Public Static Functions
Macros
Public Types Documentation
typedef TCB_t
typedef tskTCB
typedef struct tskTaskControlBlock tskTCB;
Public Attributes Documentation
variable pxCurrentTCB
PRIVILEGED_DATA TCB_t* volatile pxCurrentTCB;
Public Static Attributes Documentation
variable pxDelayedTaskList
PRIVILEGED_DATA List_t* volatile pxDelayedTaskList;
variable pxOverflowDelayedTaskList
PRIVILEGED_DATA List_t* volatile pxOverflowDelayedTaskList;
variable pxReadyTasksLists
PRIVILEGED_DATA List_t pxReadyTasksLists[configMAX_PRIORITIES];
variable uxCurrentNumberOfTasks
PRIVILEGED_DATA volatile UBaseType_t uxCurrentNumberOfTasks;
variable uxSchedulerSuspended
PRIVILEGED_DATA volatile UBaseType_t uxSchedulerSuspended;
variable uxTaskNumber
PRIVILEGED_DATA UBaseType_t uxTaskNumber;
variable uxTopReadyPriority
PRIVILEGED_DATA volatile UBaseType_t uxTopReadyPriority;
variable xDelayedTaskList1
PRIVILEGED_DATA List_t xDelayedTaskList1;
variable xDelayedTaskList2
PRIVILEGED_DATA List_t xDelayedTaskList2;
variable xIdleTaskHandle
PRIVILEGED_DATA TaskHandle_t xIdleTaskHandle;
variable xNextTaskUnblockTime
PRIVILEGED_DATA volatile TickType_t xNextTaskUnblockTime;
variable xNumOfOverflows
PRIVILEGED_DATA volatile BaseType_t xNumOfOverflows;
variable xPendedTicks
PRIVILEGED_DATA volatile TickType_t xPendedTicks;
variable xPendingReadyList
PRIVILEGED_DATA List_t xPendingReadyList;
variable xSchedulerRunning
PRIVILEGED_DATA volatile BaseType_t xSchedulerRunning;
variable xTickCount
PRIVILEGED_DATA volatile TickType_t xTickCount;
variable xYieldPending
PRIVILEGED_DATA volatile BaseType_t xYieldPending;
Public Functions Documentation
function pcTaskGetName
char * pcTaskGetName (
TaskHandle_t xTaskToQuery
)
function uxTaskGetNumberOfTasks
UBaseType_t uxTaskGetNumberOfTasks (
void
)
function uxTaskResetEventItemValue
TickType_t uxTaskResetEventItemValue (
void
)
function vTaskEndScheduler
void vTaskEndScheduler (
void
)
function vTaskInternalSetTimeOutState
void vTaskInternalSetTimeOutState (
TimeOut_t *const pxTimeOut
)
function vTaskMissedYield
void vTaskMissedYield (
void
)
function vTaskPlaceOnEventList
void vTaskPlaceOnEventList (
List_t *const pxEventList,
const TickType_t xTicksToWait
)
function vTaskPlaceOnUnorderedEventList
void vTaskPlaceOnUnorderedEventList (
List_t * pxEventList,
const TickType_t xItemValue,
const TickType_t xTicksToWait
)
function vTaskRemoveFromUnorderedEventList
void vTaskRemoveFromUnorderedEventList (
ListItem_t * pxEventListItem,
const TickType_t xItemValue
)
function vTaskSetTimeOutState
void vTaskSetTimeOutState (
TimeOut_t *const pxTimeOut
)
function vTaskStartScheduler
void vTaskStartScheduler (
void
)
function vTaskSuspendAll
void vTaskSuspendAll (
void
)
function vTaskSwitchContext
void vTaskSwitchContext (
void
)
function xTaskCatchUpTicks
BaseType_t xTaskCatchUpTicks (
TickType_t xTicksToCatchUp
)
function xTaskCheckForTimeOut
BaseType_t xTaskCheckForTimeOut (
TimeOut_t *const pxTimeOut,
TickType_t *const pxTicksToWait
)
function xTaskGetTickCount
TickType_t xTaskGetTickCount (
void
)
function xTaskGetTickCountFromISR
TickType_t xTaskGetTickCountFromISR (
void
)
function xTaskIncrementTick
BaseType_t xTaskIncrementTick (
void
)
function xTaskRemoveFromEventList
BaseType_t xTaskRemoveFromEventList (
const List_t *const pxEventList
)
function xTaskResumeAll
BaseType_t xTaskResumeAll (
void
)
Public Static Functions Documentation
function portTASK_FUNCTION
static static portTASK_FUNCTION (
prvIdleTask,
pvParameters
)
function prvAddCurrentTaskToDelayedList
static void prvAddCurrentTaskToDelayedList (
TickType_t xTicksToWait,
const BaseType_t xCanBlockIndefinitely
)
function prvAddNewTaskToReadyList
static void prvAddNewTaskToReadyList (
TCB_t * pxNewTCB
)
function prvCheckTasksWaitingTermination
static void prvCheckTasksWaitingTermination (
void
)
function prvInitialiseTaskLists
static void prvInitialiseTaskLists (
static void prvCheckTasksWaitingTermination void void
)
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.
function prvInitialiseTaskLists
static void prvInitialiseTaskLists (
void
)
function prvResetNextTaskUnblockTime
static void prvResetNextTaskUnblockTime (
void
)
Macro Definition Documentation
define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
define configIDLE_TASK_NAME
#define configIDLE_TASK_NAME "IDLE"
define portRESET_READY_PRIORITY
#define portRESET_READY_PRIORITY (
uxPriority,
uxTopReadyPriority
)
define prvAddTaskToReadyList
#define prvAddTaskToReadyList (
pxTCB
) traceMOVED_TASK_TO_READY_STATE( pxTCB ); \
taskRECORD_READY_PRIORITY( ( pxTCB )->uxPriority ); \
vListInsertEnd( &( pxReadyTasksLists[ ( pxTCB )->uxPriority ] ), &( ( pxTCB )->xStateListItem ) ); \
tracePOST_MOVED_TASK_TO_READY_STATE( pxTCB )
define prvGetTCBFromHandle
#define prvGetTCBFromHandle (
pxHandle
) ( ( ( pxHandle ) == NULL ) ? pxCurrentTCB : ( pxHandle ) )
define taskEVENT_LIST_ITEM_VALUE_IN_USE
#define taskEVENT_LIST_ITEM_VALUE_IN_USE 0x80000000UL
define taskNOTIFICATION_RECEIVED
#define taskNOTIFICATION_RECEIVED ( ( uint8_t ) 2 )
define taskNOT_WAITING_NOTIFICATION
#define taskNOT_WAITING_NOTIFICATION ( ( uint8_t ) 0 )
define taskRECORD_READY_PRIORITY
#define taskRECORD_READY_PRIORITY (
uxPriority
) { \
if( ( uxPriority ) > uxTopReadyPriority ) \
{ \
uxTopReadyPriority = ( uxPriority ); \
} \
} /* taskRECORD_READY_PRIORITY */
define taskRESET_READY_PRIORITY
#define taskRESET_READY_PRIORITY (
uxPriority
)
define taskSELECT_HIGHEST_PRIORITY_TASK
#define taskSELECT_HIGHEST_PRIORITY_TASK (
) { \
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 */
define taskSWITCH_DELAYED_LISTS
#define taskSWITCH_DELAYED_LISTS (
) { \ List_t *pxTemp; \
\
/* The delayed tasks list should be empty when the lists are switched. */ \
configASSERT( ( listLIST_IS_EMPTY( pxDelayedTaskList ) ) ); \
\
pxTemp = pxDelayedTaskList; \
pxDelayedTaskList = pxOverflowDelayedTaskList; \
pxOverflowDelayedTaskList = pxTemp; \
xNumOfOverflows++; \
prvResetNextTaskUnblockTime(); \
}
define taskWAITING_NOTIFICATION
#define taskWAITING_NOTIFICATION ( ( uint8_t ) 1 )
define taskYIELD_IF_USING_PREEMPTION
#define taskYIELD_IF_USING_PREEMPTION (
)
define tskBLOCKED_CHAR
#define tskBLOCKED_CHAR ( 'B' )
define tskDELETED_CHAR
#define tskDELETED_CHAR ( 'D' )
define tskDYNAMICALLY_ALLOCATED_STACK_AND_TCB
#define tskDYNAMICALLY_ALLOCATED_STACK_AND_TCB ( ( uint8_t ) 0 )
define tskREADY_CHAR
#define tskREADY_CHAR ( 'R' )
define tskRUNNING_CHAR
#define tskRUNNING_CHAR ( 'X' )
define tskSET_NEW_STACKS_TO_KNOWN_VALUE
#define tskSET_NEW_STACKS_TO_KNOWN_VALUE 0
define tskSTACK_FILL_BYTE
#define tskSTACK_FILL_BYTE ( 0xa5U )
define tskSTATICALLY_ALLOCATED_STACK_AND_TCB
#define tskSTATICALLY_ALLOCATED_STACK_AND_TCB ( ( uint8_t ) 2 )
define tskSTATICALLY_ALLOCATED_STACK_ONLY
#define tskSTATICALLY_ALLOCATED_STACK_ONLY ( ( uint8_t ) 1 )
define tskSUSPENDED_CHAR
#define tskSUSPENDED_CHAR ( 'S' )
The documentation for this class was generated from the following file fw/rbcx-coprocessor/lib/FreeRTOS/src/tasks.c