#include <stdlib.h>
#include <string.h>
#include "FreeRTOS.h"
#include "task.h"
#include "timers.h"
#include "stack_macros.h"
Data Structures | |
struct | tskTaskControlBlock |
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) |
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. More... | |
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 | xTaskGetTickCount (void) |
TickType_t | xTaskGetTickCountFromISR (void) |
BaseType_t | xTaskIncrementTick (void) |
BaseType_t | xTaskRemoveFromEventList (const List_t *const pxEventList) |
BaseType_t | xTaskResumeAll (void) |
#define configIDLE_TASK_NAME "IDLE" |
Referenced by vTaskStartScheduler().
#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE |
#define portRESET_READY_PRIORITY | ( | uxPriority, | |
uxTopReadyPriority | |||
) |
Referenced by prvAddCurrentTaskToDelayedList().
#define prvAddTaskToReadyList | ( | pxTCB | ) |
Referenced by prvAddNewTaskToReadyList(), vTaskRemoveFromUnorderedEventList(), xTaskIncrementTick(), xTaskRemoveFromEventList(), and xTaskResumeAll().
#define prvGetTCBFromHandle | ( | pxHandle | ) | ( ( ( pxHandle ) == NULL ) ? ( TCB_t * ) pxCurrentTCB : ( TCB_t * ) ( pxHandle ) ) |
Referenced by pcTaskGetName().
#define taskEVENT_LIST_ITEM_VALUE_IN_USE 0x80000000UL |
Referenced by vTaskPlaceOnUnorderedEventList(), and vTaskRemoveFromUnorderedEventList().
#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 | ( | ) |
Referenced by vTaskSwitchContext().
#define taskSWITCH_DELAYED_LISTS | ( | ) |
Referenced by xTaskIncrementTick().
#define taskWAITING_NOTIFICATION ( ( uint8_t ) 1 ) |
#define taskYIELD_IF_USING_PREEMPTION | ( | ) |
Referenced by prvAddNewTaskToReadyList(), and xTaskResumeAll().
#define tskBLOCKED_CHAR ( 'B' ) |
#define tskDELETED_CHAR ( 'D' ) |
#define tskDYNAMICALLY_ALLOCATED_STACK_AND_TCB ( ( uint8_t ) 0 ) |
#define tskREADY_CHAR ( 'R' ) |
#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 struct tskTaskControlBlock tskTCB |
char* pcTaskGetName | ( | TaskHandle_t | xTaskToQuery | ) |
References configASSERT, tskTaskControlBlock::pcTaskName, and prvGetTCBFromHandle.
|
static |
THIS IS THE RTOS IDLE TASK - WHICH IS CREATED AUTOMATICALLY WHEN THE
SCHEDULER IS STARTED.
References configASSERT, configEXPECTED_IDLE_TIME_BEFORE_SLEEP, configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING, listCURRENT_LIST_LENGTH, mtCOVERAGE_TEST_MARKER, portSUPPRESS_TICKS_AND_SLEEP, portTASK_CALLS_SECURE_FUNCTIONS, prvCheckTasksWaitingTermination(), pxReadyTasksLists, taskYIELD, traceLOW_POWER_IDLE_BEGIN, traceLOW_POWER_IDLE_END, vTaskSuspendAll(), xNextTaskUnblockTime, xTaskResumeAll(), and xTickCount.
|
static |
References listSET_LIST_ITEM_VALUE, mtCOVERAGE_TEST_MARKER, pdFALSE, portRESET_READY_PRIORITY, pxCurrentTCB, pxDelayedTaskList, pxOverflowDelayedTaskList, uxListRemove(), tskTaskControlBlock::uxPriority, uxTopReadyPriority, vListInsert(), vListInsertEnd(), xNextTaskUnblockTime, tskTaskControlBlock::xStateListItem, and xTickCount.
Referenced by vTaskPlaceOnEventList(), and vTaskPlaceOnUnorderedEventList().
|
static |
References mtCOVERAGE_TEST_MARKER, NULL, pdFALSE, portSETUP_TCB, prvAddTaskToReadyList, prvInitialiseTaskLists(), pxCurrentTCB, taskENTER_CRITICAL, taskEXIT_CRITICAL, taskYIELD_IF_USING_PREEMPTION, traceTASK_CREATE, uxCurrentNumberOfTasks, tskTaskControlBlock::uxPriority, uxTaskNumber, and xSchedulerRunning.
|
static |
THIS FUNCTION IS CALLED FROM THE RTOS IDLE TASK
References listGET_OWNER_OF_HEAD_ENTRY, taskENTER_CRITICAL, taskEXIT_CRITICAL, uxCurrentNumberOfTasks, uxListRemove(), and tskTaskControlBlock::xStateListItem.
Referenced by portTASK_FUNCTION().
|
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.
|
static |
|
static |
References listGET_LIST_ITEM_VALUE, listGET_OWNER_OF_HEAD_ENTRY, listLIST_IS_EMPTY, pxDelayedTaskList, and xNextTaskUnblockTime.
Referenced by xTaskRemoveFromEventList(), and xTaskResumeAll().
UBaseType_t uxTaskGetNumberOfTasks | ( | void | ) |
References uxCurrentNumberOfTasks.
TickType_t uxTaskResetEventItemValue | ( | void | ) |
Referenced by xEventGroupSync(), and xEventGroupWaitBits().
void vTaskEndScheduler | ( | void | ) |
References pdFALSE, vPortEndScheduler(), and xSchedulerRunning.
void vTaskInternalSetTimeOutState | ( | TimeOut_t *const | pxTimeOut | ) |
References xNumOfOverflows, xTIME_OUT::xOverflowCount, xTickCount, and xTIME_OUT::xTimeOnEntering.
Referenced by xQueueGenericSend(), xQueuePeek(), xQueueReceive(), xQueueSemaphoreTake(), and xTaskCheckForTimeOut().
void vTaskMissedYield | ( | void | ) |
References pdTRUE, and xYieldPending.
void vTaskPlaceOnEventList | ( | List_t *const | pxEventList, |
const TickType_t | xTicksToWait | ||
) |
void vTaskPlaceOnUnorderedEventList | ( | List_t * | pxEventList, |
const TickType_t | xItemValue, | ||
const TickType_t | xTicksToWait | ||
) |
Referenced by xEventGroupSync(), and xEventGroupWaitBits().
void vTaskRemoveFromUnorderedEventList | ( | ListItem_t * | pxEventListItem, |
const TickType_t | xItemValue | ||
) |
References configASSERT, listGET_LIST_ITEM_OWNER, listSET_LIST_ITEM_VALUE, pdTRUE, prvAddTaskToReadyList, pxCurrentTCB, taskEVENT_LIST_ITEM_VALUE_IN_USE, uxListRemove(), tskTaskControlBlock::uxPriority, uxSchedulerSuspended, tskTaskControlBlock::xStateListItem, and xYieldPending.
Referenced by vEventGroupDelete(), and xEventGroupSetBits().
void vTaskSetTimeOutState | ( | TimeOut_t *const | pxTimeOut | ) |
void vTaskStartScheduler | ( | void | ) |
References configASSERT, configIDLE_TASK_NAME, errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY, mtCOVERAGE_TEST_MARKER, NULL, pdFAIL, pdPASS, pdTRUE, portCONFIGURE_TIMER_FOR_RUN_TIME_STATS, pxCurrentTCB, tskIDLE_PRIORITY, xIdleTaskHandle, xNextTaskUnblockTime, xPortStartScheduler(), xSchedulerRunning, xTaskCreate, xTickCount, and xTimerCreateTimerTask().
void vTaskSuspendAll | ( | void | ) |
References uxSchedulerSuspended.
void vTaskSwitchContext | ( | void | ) |
BaseType_t xTaskCheckForTimeOut | ( | TimeOut_t *const | pxTimeOut, |
TickType_t *const | pxTicksToWait | ||
) |
TickType_t xTaskGetTickCount | ( | void | ) |
References portTICK_TYPE_ENTER_CRITICAL, portTICK_TYPE_EXIT_CRITICAL, and xTickCount.
TickType_t xTaskGetTickCountFromISR | ( | void | ) |
BaseType_t xTaskIncrementTick | ( | void | ) |
References listCURRENT_LIST_LENGTH, listGET_LIST_ITEM_VALUE, listGET_OWNER_OF_HEAD_ENTRY, listLIST_IS_EMPTY, listLIST_ITEM_CONTAINER, mtCOVERAGE_TEST_MARKER, NULL, pdFALSE, pdTRUE, prvAddTaskToReadyList, pxCurrentTCB, pxDelayedTaskList, pxReadyTasksLists, taskSWITCH_DELAYED_LISTS, traceTASK_INCREMENT_TICK, uxListRemove(), uxPendedTicks, tskTaskControlBlock::uxPriority, uxSchedulerSuspended, vApplicationTickHook(), tskTaskControlBlock::xEventListItem, xNextTaskUnblockTime, tskTaskControlBlock::xStateListItem, xTickCount, and xYieldPending.
BaseType_t xTaskRemoveFromEventList | ( | const List_t *const | pxEventList | ) |
References configASSERT, listGET_OWNER_OF_HEAD_ENTRY, pdFALSE, pdTRUE, prvAddTaskToReadyList, prvResetNextTaskUnblockTime(), pxCurrentTCB, uxListRemove(), tskTaskControlBlock::uxPriority, uxSchedulerSuspended, vListInsertEnd(), tskTaskControlBlock::xEventListItem, xPendingReadyList, tskTaskControlBlock::xStateListItem, and xYieldPending.
BaseType_t xTaskResumeAll | ( | void | ) |
References configASSERT, listGET_OWNER_OF_HEAD_ENTRY, listLIST_IS_EMPTY, mtCOVERAGE_TEST_MARKER, NULL, pdFALSE, pdTRUE, prvAddTaskToReadyList, prvResetNextTaskUnblockTime(), pxCurrentTCB, taskENTER_CRITICAL, taskEXIT_CRITICAL, taskYIELD_IF_USING_PREEMPTION, uxCurrentNumberOfTasks, uxListRemove(), uxPendedTicks, tskTaskControlBlock::uxPriority, uxSchedulerSuspended, tskTaskControlBlock::xEventListItem, xPendingReadyList, tskTaskControlBlock::xStateListItem, xTaskIncrementTick(), and xYieldPending.
PRIVILEGED_DATA TCB_t* volatile pxCurrentTCB = NULL |
|
static |
|
static |
Referenced by prvAddCurrentTaskToDelayedList(), and prvInitialiseTaskLists().
|
static |
Referenced by portTASK_FUNCTION(), prvInitialiseTaskLists(), and xTaskIncrementTick().
|
static |
Referenced by prvAddNewTaskToReadyList(), prvCheckTasksWaitingTermination(), uxTaskGetNumberOfTasks(), and xTaskResumeAll().
|
static |
Referenced by xTaskIncrementTick(), and xTaskResumeAll().
|
static |
|
static |
Referenced by prvAddNewTaskToReadyList().
|
static |
Referenced by prvAddCurrentTaskToDelayedList().
|
static |
Referenced by prvInitialiseTaskLists().
|
static |
Referenced by prvInitialiseTaskLists().
|
static |
Referenced by vTaskStartScheduler().
|
static |
|
static |
Referenced by vTaskInternalSetTimeOutState(), vTaskSetTimeOutState(), and xTaskCheckForTimeOut().
|
static |
Referenced by prvInitialiseTaskLists(), xTaskRemoveFromEventList(), and xTaskResumeAll().
|
static |
Referenced by prvAddNewTaskToReadyList(), vTaskEndScheduler(), and vTaskStartScheduler().
|
static |
|
static |