#include <stdlib.h>
#include <string.h>
#include "FreeRTOS.h"
#include "task.h"
#include "timers.h"
#include "StackMacros.h"
Data Structures | |
struct | tskTaskControlBlock |
Macros | |
#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 | taskRECORD_READY_PRIORITY(uxPriority) |
#define | taskRESET_READY_PRIORITY(uxPriority) |
#define | taskSELECT_HIGHEST_PRIORITY_TASK() |
#define | taskSWITCH_DELAYED_LISTS() |
#define | taskYIELD_IF_USING_PREEMPTION() |
#define | tskBLOCKED_CHAR ( 'B' ) |
#define | tskDELETED_CHAR ( 'D' ) |
#define | tskIDLE_STACK_SIZE configMINIMAL_STACK_SIZE |
#define | tskREADY_CHAR ( 'R' ) |
#define | tskSTACK_FILL_BYTE ( 0xa5U ) |
#define | tskSUSPENDED_CHAR ( 'S' ) |
Typedefs | |
typedef tskTCB | TCB_t |
typedef struct tskTaskControlBlock | tskTCB |
Functions | |
static | portTASK_FUNCTION (prvIdleTask, pvParameters) |
static void | prvAddCurrentTaskToDelayedList (const TickType_t xTimeToWake) |
static TCB_t * | prvAllocateTCBAndStack (const uint16_t usStackDepth, StackType_t *const puxStackBuffer) |
static void | prvCheckTasksWaitingTermination (void) |
static void | prvInitialiseTaskLists (static void prvCheckTasksWaitingTermination void) |
static void | prvInitialiseTaskLists (void) |
static void | prvInitialiseTCBVariables (TCB_t *const pxTCB, const char *const pcName, UBaseType_t uxPriority, const MemoryRegion_t *const xRegions, const uint16_t usStackDepth) PRIVILEGED_FUNCTION |
static void | prvResetNextTaskUnblockTime (void) |
static BaseType_t | prvTaskIsTaskSuspended (const TaskHandle_t xTask) PRIVILEGED_FUNCTION |
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... | |
UBaseType_t | uxTaskGetNumberOfTasks (void) |
TickType_t | uxTaskResetEventItemValue (void) |
void | vTaskEndScheduler (void) |
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 | 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 | xTaskRemoveFromUnorderedEventList (ListItem_t *pxEventListItem, const TickType_t xItemValue) |
BaseType_t | xTaskResumeAll (void) |
#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE |
#define portRESET_READY_PRIORITY | ( | uxPriority, | |
uxTopReadyPriority | |||
) |
Referenced by vTaskPlaceOnEventList(), and vTaskPlaceOnUnorderedEventList().
#define prvAddTaskToReadyList | ( | pxTCB | ) |
Referenced by xTaskIncrementTick(), xTaskRemoveFromEventList(), xTaskRemoveFromUnorderedEventList(), and xTaskResumeAll().
#define prvGetTCBFromHandle | ( | pxHandle | ) | ( ( ( pxHandle ) == NULL ) ? ( TCB_t * ) pxCurrentTCB : ( TCB_t * ) ( pxHandle ) ) |
#define taskEVENT_LIST_ITEM_VALUE_IN_USE 0x80000000UL |
Referenced by vTaskPlaceOnUnorderedEventList(), and xTaskRemoveFromUnorderedEventList().
#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 taskYIELD_IF_USING_PREEMPTION | ( | ) |
Referenced by xTaskResumeAll().
#define tskBLOCKED_CHAR ( 'B' ) |
#define tskDELETED_CHAR ( 'D' ) |
#define tskIDLE_STACK_SIZE configMINIMAL_STACK_SIZE |
Referenced by vTaskStartScheduler().
#define tskREADY_CHAR ( 'R' ) |
#define tskSTACK_FILL_BYTE ( 0xa5U ) |
Referenced by prvAllocateTCBAndStack().
#define tskSUSPENDED_CHAR ( 'S' ) |
typedef struct tskTaskControlBlock tskTCB |
|
static |
References configASSERT, configEXPECTED_IDLE_TIME_BEFORE_SLEEP, listCURRENT_LIST_LENGTH, mtCOVERAGE_TEST_MARKER, portSUPPRESS_TICKS_AND_SLEEP, prvCheckTasksWaitingTermination(), pxReadyTasksLists, taskYIELD, traceLOW_POWER_IDLE_BEGIN, traceLOW_POWER_IDLE_END, vTaskSuspendAll(), xNextTaskUnblockTime, xTaskResumeAll(), and xTickCount.
|
static |
|
static |
References NULL, pvPortMalloc(), pvPortMallocAligned, tskTaskControlBlock::pxStack, tskSTACK_FILL_BYTE, and vPortFree().
|
static |
|
static |
|
static |
|
static |
References configMAX_TASK_NAME_LEN, listSET_LIST_ITEM_OWNER, listSET_LIST_ITEM_VALUE, mtCOVERAGE_TEST_MARKER, NULL, tskTaskControlBlock::pcTaskName, tskTaskControlBlock::pxStack, tskTaskControlBlock::uxPriority, vListInitialiseItem(), tskTaskControlBlock::xEventListItem, and tskTaskControlBlock::xGenericListItem.
|
static |
|
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.
UBaseType_t uxTaskGetNumberOfTasks | ( | void | ) |
References uxCurrentNumberOfTasks.
TickType_t uxTaskResetEventItemValue | ( | void | ) |
void vTaskEndScheduler | ( | void | ) |
References pdFALSE, vPortEndScheduler(), and xSchedulerRunning.
void vTaskMissedYield | ( | void | ) |
References pdTRUE, and xYieldPending.
void vTaskPlaceOnEventList | ( | List_t *const | pxEventList, |
const TickType_t | xTicksToWait | ||
) |
References configASSERT, mtCOVERAGE_TEST_MARKER, pdTRUE, portRESET_READY_PRIORITY, prvAddCurrentTaskToDelayedList(), pxCurrentTCB, uxListRemove(), tskTaskControlBlock::uxPriority, uxTopReadyPriority, vListInsert(), vListInsertEnd(), tskTaskControlBlock::xEventListItem, tskTaskControlBlock::xGenericListItem, and xTickCount.
void vTaskPlaceOnUnorderedEventList | ( | List_t * | pxEventList, |
const TickType_t | xItemValue, | ||
const TickType_t | xTicksToWait | ||
) |
References configASSERT, listSET_LIST_ITEM_VALUE, mtCOVERAGE_TEST_MARKER, pdTRUE, portRESET_READY_PRIORITY, prvAddCurrentTaskToDelayedList(), pxCurrentTCB, taskEVENT_LIST_ITEM_VALUE_IN_USE, uxListRemove(), tskTaskControlBlock::uxPriority, uxSchedulerSuspended, uxTopReadyPriority, vListInsertEnd(), tskTaskControlBlock::xEventListItem, tskTaskControlBlock::xGenericListItem, and xTickCount.
void vTaskSetTimeOutState | ( | TimeOut_t *const | pxTimeOut | ) |
References configASSERT, xNumOfOverflows, xTIME_OUT::xOverflowCount, xTickCount, and xTIME_OUT::xTimeOnEntering.
void vTaskStartScheduler | ( | void | ) |
References configASSERT, mtCOVERAGE_TEST_MARKER, NULL, pdPASS, pdTRUE, portCONFIGURE_TIMER_FOR_RUN_TIME_STATS, portPRIVILEGE_BIT, portTickType, pxCurrentTCB, tskIDLE_PRIORITY, tskIDLE_STACK_SIZE, xIdleTaskHandle, 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 portTickType, taskENTER_CRITICAL, taskEXIT_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, portTickType, prvAddTaskToReadyList, pxCurrentTCB, pxDelayedTaskList, pxReadyTasksLists, taskSWITCH_DELAYED_LISTS, traceTASK_INCREMENT_TICK, uxListRemove(), uxPendedTicks, tskTaskControlBlock::uxPriority, uxSchedulerSuspended, vApplicationTickHook(), tskTaskControlBlock::xEventListItem, tskTaskControlBlock::xGenericListItem, xNextTaskUnblockTime, xTickCount, and xYieldPending.
BaseType_t xTaskRemoveFromEventList | ( | const List_t *const | pxEventList | ) |
References configASSERT, listGET_OWNER_OF_HEAD_ENTRY, pdFALSE, pdTRUE, prvAddTaskToReadyList, pxCurrentTCB, uxListRemove(), tskTaskControlBlock::uxPriority, uxSchedulerSuspended, vListInsertEnd(), tskTaskControlBlock::xEventListItem, tskTaskControlBlock::xGenericListItem, xPendingReadyList, and xYieldPending.
BaseType_t xTaskRemoveFromUnorderedEventList | ( | ListItem_t * | pxEventListItem, |
const TickType_t | xItemValue | ||
) |
BaseType_t xTaskResumeAll | ( | void | ) |
References configASSERT, listGET_OWNER_OF_HEAD_ENTRY, listLIST_IS_EMPTY, mtCOVERAGE_TEST_MARKER, pdFALSE, pdTRUE, portYIELD_WITHIN_API, prvAddTaskToReadyList, pxCurrentTCB, taskENTER_CRITICAL, taskEXIT_CRITICAL, taskYIELD_IF_USING_PREEMPTION, uxCurrentNumberOfTasks, uxListRemove(), uxPendedTicks, tskTaskControlBlock::uxPriority, uxSchedulerSuspended, tskTaskControlBlock::xEventListItem, tskTaskControlBlock::xGenericListItem, xPendingReadyList, 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 prvCheckTasksWaitingTermination(), uxTaskGetNumberOfTasks(), and xTaskResumeAll().
|
static |
Referenced by xTaskIncrementTick(), and xTaskResumeAll().
|
static |
|
static |
|
static |
Referenced by vTaskPlaceOnEventList(), and vTaskPlaceOnUnorderedEventList().
|
static |
Referenced by prvInitialiseTaskLists().
|
static |
Referenced by prvInitialiseTaskLists().
|
static |
Referenced by portTASK_FUNCTION(), prvAddCurrentTaskToDelayedList(), prvResetNextTaskUnblockTime(), and xTaskIncrementTick().
|
static |
Referenced by vTaskSetTimeOutState(), and xTaskCheckForTimeOut().
|
static |
Referenced by prvInitialiseTaskLists(), xTaskRemoveFromEventList(), and xTaskResumeAll().
|
static |
Referenced by vTaskEndScheduler(), and vTaskStartScheduler().
|
static |
|
static |