3#ifndef TETL_FREERTOS_TASK_HPP
4#define TETL_FREERTOS_TASK_HPP
11#if defined(TETL_FREERTOS_USE_STUBS)
18 [[nodiscard]]
auto operator()() const ->
bool {
return false; }
23 [[nodiscard]]
auto operator()() const ->
bool {
return true; }
27template <etl::
size_t Count>
41template <
typename TaskType>
44 static_cast<TaskType*
>(task)->run();
48template <
typename TaskType>
51 char const*
const name,
constexpr auto prev(BidirIt it, typename iterator_traits< BidirIt >::difference_type n=1) -> BidirIt
Return the nth predecessor of iterator it.
Definition prev.hpp:14
auto sleep_for(etl::uint32_t ticks) -> void
Delay a task for a given number of ticks. The actual time that the task remains blocked depends on th...
Definition task.hpp:121
auto sleep_until(etl::uint32_t &prev, etl::uint32_t increment) -> void
Delay a task until a specified time. This function can be used by periodic tasks to ensure a constant...
Definition task.hpp:123
auto yield() -> void
Request a context switch to another task.
Definition task.hpp:119
auto delete_task(TaskHandle_t task) -> void
Delete a rtos task. If handle is nullptr, the current task will be deleted.
Definition task.hpp:62
auto rtos_task(void *task) -> void
Wrapper for an rtos task struct. Calls the run() member.
Definition task.hpp:42
auto create_task(TaskType &task, char const *const name, uint16_t stack, UBaseType_t prio=0, TaskHandle_t *const handle=nullptr) -> void
Create a rtos task. TaskType needs a void run() public method.
Definition task.hpp:49
times< 1 > once
Runs the task loop once.
Definition task.hpp:35
times< 2 > twice
Runs the task loop twice.
Definition task.hpp:38
auto start_scheduler() -> void
Start the RTOS, this function will never return and will schedule the tasks.
Definition task.hpp:66
TETL_BUILTIN_UINT16 uint16_t
Unsigned integer type with width of exactly 16 bits.
Definition uint_t.hpp:14
TETL_BUILTIN_UINT32 uint32_t
Unsigned integer type with width of exactly 32 bits.
Definition uint_t.hpp:17
TETL_BUILTIN_SIZET size_t
etl::size_t is the unsigned integer type of the result of the sizeof operator.
Definition size_t.hpp:14
Runs the task loop forever.
Definition task.hpp:22
auto operator()() const -> bool
Definition task.hpp:23
Runs the task loop 0 times.
Definition task.hpp:17
auto operator()() const -> bool
Definition task.hpp:18
Runs the task loop Count times.
Definition task.hpp:28
etl::size_t run_count
Definition task.hpp:29
auto operator()() -> bool
Definition task.hpp:31
The stack class is a container adapter that gives the programmer the functionality of a stack - speci...
Definition stack.hpp:31
tskTaskControlBlock * TaskHandle_t
Definition stubs.hpp:35
unsigned long UBaseType_t
Definition stubs.hpp:14
auto vTaskStartScheduler() -> void
Definition stubs.hpp:53
auto xTaskCreate(TaskFunction_t pvTaskCode, char const *const pcName, configSTACK_DEPTH_TYPE usStackDepth, void *const pvParameters, UBaseType_t uxPriority, TaskHandle_t *const pxCreatedTask) -> BaseType_t
Definition stubs.hpp:38
auto vTaskDelete(TaskHandle_t xTask) -> void
Definition stubs.hpp:51
#define taskYIELD()
Definition stubs.hpp:30
auto vTaskDelayUntil(TickType_t *const pxPreviousWakeTime, TickType_t const xTimeIncrement) -> void
Definition stubs.hpp:57
auto vTaskDelay(TickType_t const xTicksToDelay) -> void
Definition stubs.hpp:55