arduino-audio-tools
Loading...
Searching...
No Matches
Public Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
TaskZephyr Class Reference

Zephyr thread based task. More...

#include <Task.h>

Public Member Functions

 TaskZephyr ()=default
 
 TaskZephyr (const char *name, int stackSize, int priority=1, int core=-1)
 Defines and creates a task.
 
 ~TaskZephyr ()
 
bool begin (std::function< void()> process)
 
bool create (const char *name, int stackSize, int priority=1, int core=-1)
 If you used the empty constructor, you need to call create!
 
void end ()
 suspends the task
 
voidgetReference ()
 
TaskHandle_tgetTaskHandle ()
 
void remove ()
 deletes the task
 
void resume ()
 
void setReference (void *r)
 
void suspend ()
 

Static Protected Member Functions

static void nop ()
 
static void task_loop (void *arg, void *p2, void *p3)
 

Protected Attributes

bool is_started = false
 
std::function< void()> loop_code = nop
 
k_thread_stack_tp_stack = nullptr
 
voidref = nullptr
 
size_t stack_size = 0
 
struct k_thread thread_data
 
TaskHandle_t xHandle = nullptr
 

Detailed Description

Zephyr thread based task.

Note
Supported by all Zephyr platforms

Constructor & Destructor Documentation

◆ TaskZephyr() [1/2]

TaskZephyr ( const char name,
int  stackSize,
int  priority = 1,
int  core = -1 
)
inline

Defines and creates a task.

◆ TaskZephyr() [2/2]

TaskZephyr ( )
default

◆ ~TaskZephyr()

~TaskZephyr ( )
inline

Member Function Documentation

◆ begin()

bool begin ( std::function< void()>  process)
inline

◆ create()

bool create ( const char name,
int  stackSize,
int  priority = 1,
int  core = -1 
)
inline

If you used the empty constructor, you need to call create!

◆ end()

void end ( )
inline

suspends the task

◆ getReference()

void * getReference ( )
inline

◆ getTaskHandle()

TaskHandle_t & getTaskHandle ( )
inline

◆ nop()

static void nop ( )
inlinestaticprotected

◆ remove()

void remove ( )
inline

deletes the task

◆ resume()

void resume ( )
inline

◆ setReference()

void setReference ( void r)
inline

◆ suspend()

void suspend ( )
inline

◆ task_loop()

static void task_loop ( void arg,
void p2,
void p3 
)
inlinestaticprotected

Member Data Documentation

◆ is_started

bool is_started = false
protected

◆ loop_code

std::function<void()> loop_code = nop
protected

◆ p_stack

k_thread_stack_t* p_stack = nullptr
protected

◆ ref

void* ref = nullptr
protected

◆ stack_size

size_t stack_size = 0
protected

◆ thread_data

struct k_thread thread_data
protected

◆ xHandle

TaskHandle_t xHandle = nullptr
protected

The documentation for this class was generated from the following file: