5#include <freertos/FreeRTOS.h>
6#include <freertos/task.h>
43 bool use_psram, BaseType_t core_id = tskNO_AFFINITY);
Helper for FreeRTOS static task management.
bool is_created() const
Check if the task has been created and not yet destroyed.
RAMUniquePtr< StackType_t[]> stack_buffer_
bool destroy()
Delete the task, keeping the TCB and stack buffer allocated for reuse by a subsequent create() call.
StaticTask(StaticTask &&)=delete
TaskHandle_t get_handle() const
Get the FreeRTOS task handle.
bool deallocate()
Delete the task (if created) and free the TCB and stack buffer.
RAMUniquePtr< StaticTask_t > tcb_
StaticTask & operator=(const StaticTask &)=delete
bool create(TaskFunction_t fn, const char *name, uint32_t stack_size, void *param, UBaseType_t priority, bool use_psram, BaseType_t core_id=tskNO_AFFINITY)
Allocate the TCB (always internal RAM) and the stack, then create the task.
StaticTask & operator=(StaticTask &&)=delete
StaticTask(const StaticTask &)=delete
std::unique_ptr< T, RAMDeleter< T > > RAMUniquePtr
unique_ptr over RAMAllocator storage