FreeRTOS-Cpp
|
Kernel namespace that provides an interface to kernel functions. More...
Enumerations | |
enum class | SchedulerState : BaseType_t { Suspended = taskSCHEDULER_SUSPENDED , NotStarted = taskSCHEDULER_NOT_STARTED , Running = taskSCHEDULER_RUNNING } |
Functions | |
SchedulerState | getSchedulerState () |
Function that calls xTaskGetSchedulerState() More... | |
UBaseType_t | getNumberOfTasks () |
Function that calls uxTaskGetNumberOfTasks() More... | |
TickType_t | getIdleRunTimeCounter () |
Function that calls xTaskGetIdleRunTimeCounter() More... | |
TickType_t | getTickCount () |
Function that calls xTaskGetTickCount() More... | |
TickType_t | getTickCountFromISR () |
Function that calls xTaskGetTickCountFromISR() More... | |
void | yield () |
Function that calls taskYIELD() More... | |
void | enterCritical () |
Function that calls taskENTER_CRITICAL() More... | |
uint32_t | enterCriticalFromISR () |
Function that calls taskENTER_CRITICAL_FROM_ISR() More... | |
void | exitCritical () |
Function that calls taskEXIT_CRITICAL() More... | |
void | exitCriticalFromISR (const uint32_t interruptStatus) |
Function that calls taskEXIT_CRITICAL_FROM_ISR() More... | |
void | disableInterrupts () |
Function that calls taskDISABLE_INTERRUPTS() More... | |
void | enableInterrupts () |
Function that calls taskENABLE_INTERRUPTS() More... | |
void | startScheduler () |
Function that calls vTaskStartScheduler() More... | |
void | endScheduler () |
Function that calls vTaskEndScheduler() More... | |
void | suspendAll () |
Function that calls vTaskSuspendAll() More... | |
bool | resumeAll () |
Function that calls xTaskResumeAll() More... | |
void | stepTick (const TickType_t ticksToJump) |
Function that calls vTaskStepTick( const TickType_t xTicksToJump ) More... | |
bool | catchUpTicks (const TickType_t ticksToCatchUp) |
Function that calls xTaskCatchUpTicks( TickType_t xTicksToCatchUp ) More... | |
Variables | |
constexpr char | versionNumber [] = tskKERNEL_VERSION_NUMBER |
If versionNumber ends with + it represents the version in development after the numbered release. | |
constexpr BaseType_t | versionMajor = tskKERNEL_VERSION_MAJOR |
constexpr BaseType_t | versionMinor = tskKERNEL_VERSION_MINOR |
constexpr BaseType_t | versionBuild = tskKERNEL_VERSION_BUILD |
Kernel namespace that provides an interface to kernel functions.
|
inline |
Function that calls xTaskCatchUpTicks( TickType_t xTicksToCatchUp )
This function corrects the tick count value after the application code has held interrupts disabled for an extended period resulting in tick interrupts having been missed.
This function is similar to FreeRTOS::Kernel::stepTick(), however, unlike FreeRTOS::Kernel::stepTick(), FreeRTOS::Kernel::catchUpTicks() may move the tick count forward past a time at which a task should be removed from the blocked state. That means tasks may have to be removed from the blocked state as the tick count is moved.
ticksToCatchUp | The number of tick interrupts that have been missed due to interrupts being disabled. Its value is not computed automatically, so must be computed by the application writer. |
true | If moving the tick count forward resulted in a task leaving the blocked state and a context switch being performed. |
false | Otherwise. |
|
inline |
Function that calls taskDISABLE_INTERRUPTS()
Function to disable all maskable interrupts.
|
inline |
Function that calls taskENABLE_INTERRUPTS()
Function to enable microcontroller interrupts.
|
inline |
Function that calls vTaskEndScheduler()
Stops the real time kernel tick. All created tasks will be automatically deleted and multitasking (either preemptive or cooperative) will stop. Execution then resumes from the point where FreeRTOS::Kernel::startScheduler() was called, as if FreeRTOS::Kernel::startScheduler() had just returned.
See the demo application file main. c in the demo/PC directory for an example that uses FreeRTOS::Kernel::endScheduler().
FreeRTOS::Kernel::endScheduler() requires an exit function to be defined within the portable layer (see vPortEndScheduler () in port. c for the PC port). This performs hardware specific operations such as stopping the kernel tick.
FreeRTOS::Kernel::endScheduler() will cause all of the resources allocated by the kernel to be freed - but will not free resources allocated by application tasks.
Example Usage
|
inline |
Function that calls taskENTER_CRITICAL()
Function to mark the start of a critical code region. Preemptive context switches cannot occur when in a critical region.
Example Usage
|
inline |
Function that calls taskENTER_CRITICAL_FROM_ISR()
uint32_t | the interrupt mask state as it was before the macro was called. The value returned by FreeRTOS::Kernel::enterCriticalFromISR() must be used as the interruptStatus parameter in the matching call to FreeRTOS::Kernel::exitCriticalFromISR(). |
Function to mark the start of a critical code region. Preemptive context switches cannot occur when in a critical region.
Example Usage
|
inline |
Function that calls taskEXIT_CRITICAL()
Function to mark the end of a critical code region. Preemptive context switches cannot occur when in a critical region.
Example Usage
|
inline |
Function that calls taskEXIT_CRITICAL_FROM_ISR()
interruptStatus | The value used as the interruptStatus parameter must be the value returned from the matching call to FreeRTOS::Kernel::enterCriticalFromISR(). |
Function to mark the end of a critical code region. Preemptive context switches cannot occur when in a critical region.
Example Usage
|
inline |
Function that calls xTaskGetIdleRunTimeCounter()
TickType_t | The run-time counter for the Idle task. |
This function can be used to determine how much CPU time the idle task receives. See the Run Time Stats page for a full description of the run-time-stats feature.
configGENERATE_RUN_TIME_STATS and INCLUDE_xTaskGetIdleTaskHandle must both be defined as 1 for this function to be available. The application must also then provide definitions for portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() and portGET_RUN_TIME_COUNTER_VALUE to configure a peripheral timer/counter and return the timer's current count value respectively. It is recommended to make the timer at least 10 times the frequency of the tick count.
|
inline |
Function that calls uxTaskGetNumberOfTasks()
UBaseType_t | The number of tasks that the real time kernel is currently managing. This includes all ready, blocked and suspended tasks. A task that has been deleted but not yet freed by the idle task will also be included in the count. |
|
inline |
Function that calls xTaskGetSchedulerState()
SchedulerState | Returns the scheduler state as Running, NotStarted, or Suspended. |
|
inline |
Function that calls xTaskGetTickCount()
TickType_t | The count of ticks since FreeRTOS::Kernel::startScheduler() was called. |
|
inline |
Function that calls xTaskGetTickCountFromISR()
TickType_t | The count of ticks since FreeRTOS::Kernel::startScheduler() was called. |
This is a version of FreeRTOS::Kernel::getTickCount() that is safe to be called from an ISR - provided that TickType_t is the natural word size of the microcontroller being used or interrupt nesting is either not supported or not being used.
|
inline |
Function that calls xTaskResumeAll()
Resumes scheduler activity after it was suspended by a call to FreeRTOS::Kernel::suspendAll().
FreeRTOS::Kernel::resumeAll() only resumes the scheduler. It does not unsuspend tasks that were previously suspended by a call to FreeRTOS::Task::suspend().
true | If resuming the scheduler caused a context switch. |
false | Otherwise. |
Example Usage
|
inline |
Function that calls vTaskStartScheduler()
Starts the real time kernel tick processing. After calling the kernel has control over which tasks are executed and when.
Example Usage
|
inline |
Function that calls vTaskStepTick( const TickType_t xTicksToJump )
Only available when configUSE_TICKLESS_IDLE is set to 1. If tickless mode is being used, or a low power mode is implemented, then the tick interrupt will not execute during idle periods. When this is the case, the tick count value maintained by the scheduler needs to be kept up to date with the actual execution time by being skipped forward by a time equal to the idle period.
ticksToJump | The number of RTOS ticks that have passed since the tick interrupt was stopped. |
|
inline |
Function that calls vTaskSuspendAll()
Suspends the scheduler without disabling interrupts. Context switches will not occur while the scheduler is suspended.
After calling FreeRTOS::Kernel::suspendAll() the calling task will continue to execute without risk of being swapped out until a call to FreeRTOS::Kernel::resumeAll() has been made.
API functions that have the potential to cause a context switch (for example, FreeRTOS::Task::delayUntil(), FreeRTOS::Queue::send(), etc.) must not be called while the scheduler is suspended.
Example Usage
|
inline |
Function that calls taskYIELD()
FreeRTOS::Kernel::yield() is used to request a context switch to another task. However, if there are no other tasks at a higher or equal priority to the task that calls FreeRTOS::Kernel::yield() then the RTOS scheduler will simply select the task that called FreeRTOS::Kernel::yield() to run again.