#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 tskTCB * | prvAllocateTCBAndStack (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) |
Called if stack overflow during execution. More... | |
void | vApplicationTickHook (void) |
This function is called by FreeRTOS each tick. More... | |
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) |
#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE |
#define prvAddTaskToReadyQueue | ( | pxTCB | ) |
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 |
|
static |
References listSET_LIST_ITEM_VALUE, pxCurrentTCB, pxDelayedTaskList, pxOverflowDelayedTaskList, vListInsert(), tskTaskControlBlock::xGenericListItem, xNextTaskUnblockTime, and xTickCount.
Referenced by vTaskPlaceOnEventList().
|
static |
References NULL, pvPortMalloc(), pvPortMallocAligned, tskTaskControlBlock::pxStack, tskSTACK_FILL_BYTE, and vPortFree().
Referenced by prvInitialiseTaskLists().
|
static |
|
static |
References configASSERT, errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY, NULL, pdFALSE, pdPASS, pdTRUE, portPRIVILEGE_BIT, portYIELD_WITHIN_API, prvAddTaskToReadyQueue, prvAllocateTCBAndStack(), prvInitialiseTaskLists(), prvInitialiseTCBVariables(), pxCurrentTCB, pxPortInitialiseStack(), tskTaskControlBlock::pxStack, tskTaskControlBlock::pxTopOfStack, taskENTER_CRITICAL, taskEXIT_CRITICAL, traceTASK_CREATE, traceTASK_CREATE_FAILED, uxCurrentNumberOfTasks, tskTaskControlBlock::uxPriority, uxTaskNumber, uxTopUsedPriority, xSchedulerRunning, and xTaskHandle.
|
static |
|
static |
References configMAX_TASK_NAME_LEN, listSET_LIST_ITEM_OWNER, listSET_LIST_ITEM_VALUE, NULL, tskTaskControlBlock::pcTaskName, portTickType, tskTaskControlBlock::pxStack, tskTaskControlBlock::uxPriority, vListInitialiseItem(), tskTaskControlBlock::xEventListItem, and tskTaskControlBlock::xGenericListItem.
Referenced by prvInitialiseTaskLists().
unsigned portBASE_TYPE uxTaskGetNumberOfTasks | ( | void | ) |
References uxCurrentNumberOfTasks.
void vApplicationStackOverflowHook | ( | xTaskHandle * | pxTask, |
signed char * | pcTaskName | ||
) |
Called if stack overflow during execution.
void vApplicationTickHook | ( | void | ) |
This function is called by FreeRTOS each tick.
void vTaskEndScheduler | ( | void | ) |
References pdFALSE, vPortEndScheduler(), and xSchedulerRunning.
void vTaskIncrementTick | ( | void | ) |
References configASSERT, listGET_LIST_ITEM_VALUE, listGET_OWNER_OF_HEAD_ENTRY, listLIST_IS_EMPTY, portTickType, prvCheckDelayedTasks, pxDelayedTaskList, pxOverflowDelayedTaskList, traceTASK_INCREMENT_TICK, uxMissedTicks, uxSchedulerSuspended, vApplicationTickHook(), tskTaskControlBlock::xGenericListItem, xNextTaskUnblockTime, xNumOfOverflows, and xTickCount.
void vTaskMissedYield | ( | void | ) |
References pdTRUE, and xMissedYield.
void vTaskPlaceOnEventList | ( | const xList *const | pxEventList, |
portTickType | xTicksToWait | ||
) |
References configASSERT, portRESET_READY_PRIORITY, portTickType, prvAddCurrentTaskToDelayedList(), pxCurrentTCB, uxListRemove(), tskTaskControlBlock::uxPriority, uxTopReadyPriority, vListInsert(), vListInsertEnd(), vListRemove(), tskTaskControlBlock::xEventListItem, tskTaskControlBlock::xGenericListItem, and xTickCount.
void vTaskSetTimeOutState | ( | xTimeOutType *const | pxTimeOut | ) |
References configASSERT, xNumOfOverflows, xTIME_OUT::xOverflowCount, xTickCount, and xTIME_OUT::xTimeOnEntering.
void vTaskStartScheduler | ( | void | ) |
void vTaskSuspendAll | ( | void | ) |
References uxSchedulerSuspended.
void vTaskSwitchContext | ( | void | ) |
References configASSERT, listGET_OWNER_OF_NEXT_ENTRY, listLIST_IS_EMPTY, pdTRUE, pxCurrentTCB, pxReadyTasksLists, taskFIRST_CHECK_FOR_STACK_OVERFLOW, taskSECOND_CHECK_FOR_STACK_OVERFLOW, traceTASK_SWITCHED_IN, traceTASK_SWITCHED_OUT, uxSchedulerSuspended, uxTopReadyPriority, vWriteTraceToBuffer, and xMissedYield.
portBASE_TYPE xTaskCheckForTimeOut | ( | xTimeOutType *const | pxTimeOut, |
portTickType *const | pxTicksToWait | ||
) |
portTickType xTaskGetTickCount | ( | void | ) |
References portTickType, taskENTER_CRITICAL, taskEXIT_CRITICAL, and xTickCount.
portTickType xTaskGetTickCountFromISR | ( | void | ) |
References portCLEAR_INTERRUPT_MASK_FROM_ISR, portSET_INTERRUPT_MASK_FROM_ISR, portTickType, and xTickCount.
signed portBASE_TYPE xTaskRemoveFromEventList | ( | const xList *const | pxEventList | ) |
signed portBASE_TYPE xTaskResumeAll | ( | void | ) |
References configASSERT, listGET_OWNER_OF_HEAD_ENTRY, listLIST_IS_EMPTY, pdFALSE, pdTRUE, portYIELD_WITHIN_API, prvAddTaskToReadyQueue, pxCurrentTCB, taskENTER_CRITICAL, taskEXIT_CRITICAL, uxCurrentNumberOfTasks, uxMissedTicks, tskTaskControlBlock::uxPriority, uxSchedulerSuspended, vListRemove(), vTaskIncrementTick(), tskTaskControlBlock::xEventListItem, tskTaskControlBlock::xGenericListItem, xMissedYield, and xPendingReadyList.
PRIVILEGED_DATA tskTCB* volatile pxCurrentTCB = NULL |
|
static |
Referenced by prvAddCurrentTaskToDelayedList(), prvInitialiseTaskLists(), and vTaskIncrementTick().
|
static |
Referenced by prvAddCurrentTaskToDelayedList(), prvInitialiseTaskLists(), and vTaskIncrementTick().
|
static |
Referenced by portTASK_FUNCTION(), prvInitialiseTaskLists(), and vTaskSwitchContext().
|
static |
Referenced by prvCheckTasksWaitingTermination(), prvInitialiseTaskLists(), uxTaskGetNumberOfTasks(), and xTaskResumeAll().
|
static |
Referenced by vTaskIncrementTick(), and xTaskResumeAll().
|
static |
Referenced by vTaskIncrementTick(), vTaskSuspendAll(), vTaskSwitchContext(), xTaskRemoveFromEventList(), and xTaskResumeAll().
|
static |
Referenced by prvInitialiseTaskLists().
|
static |
Referenced by vTaskSwitchContext().
|
static |
Referenced by prvInitialiseTaskLists().
|
static |
Referenced by prvInitialiseTaskLists().
|
static |
Referenced by prvInitialiseTaskLists().
|
static |
Referenced by vTaskMissedYield(), vTaskSwitchContext(), and xTaskResumeAll().
|
static |
Referenced by prvAddCurrentTaskToDelayedList(), and vTaskIncrementTick().
|
static |
Referenced by vTaskIncrementTick(), vTaskSetTimeOutState(), and xTaskCheckForTimeOut().
|
static |
Referenced by prvInitialiseTaskLists(), xTaskRemoveFromEventList(), and xTaskResumeAll().
|
static |
Referenced by prvInitialiseTaskLists(), vTaskEndScheduler(), and vTaskStartScheduler().
|
static |