pros::rtos::Task class

Public static functions

template<class F>
static task_t create(F&& function, std::uint32_t prio = TASK_PRIORITY_DEFAULT, std::uint16_t stack_depth = TASK_STACK_DEPTH_DEFAULT, const char* name = "")
Creates a new task and add it to the list of tasks that are ready to run.
template<class F>
static task_t create(F&& function, const char* name)
Creates a new task and add it to the list of tasks that are ready to run.
static Task current()
Get the currently running Task.
static std::uint32_t notify_take(bool clear_on_exit, std::uint32_t timeout)
Waits for a notification to be nonzero.
static void delay(const std::uint32_t milliseconds)
Delays the current task for a specified number of milliseconds.
static void delay_until(std::uint32_t*const prev_time, const std::uint32_t delta)
Delays the current Task until a specified time.
static std::uint32_t get_count()
Gets the number of tasks the kernel is currently managing, including all ready, blocked, or suspended tasks.

Constructors, destructors, conversion operators

Task(task_fn_t function, void* parameters = nullptr, std::uint32_t prio = TASK_PRIORITY_DEFAULT, std::uint16_t stack_depth = TASK_STACK_DEPTH_DEFAULT, const char* name = "")
Creates a new task and add it to the list of tasks that are ready to run.
Task(task_fn_t function, void* parameters, const char* name)
Creates a new task and add it to the list of tasks that are ready to run.
template<class F>
Task(F&& function, std::uint32_t prio = TASK_PRIORITY_DEFAULT, std::uint16_t stack_depth = TASK_STACK_DEPTH_DEFAULT, const char* name = "") explicit
Creates a new task and add it to the list of tasks that are ready to run.
template<class F>
Task(F&& function, const char* name)
Creates a new task and add it to the list of tasks that are ready to run.
Task(task_t task) explicit
Create a C++ task object from a task handle.
operator task_t() explicit
Convert this object to a C task_t handle.

Public functions

Task& operator=(task_t in)
Creates a task object from the passed task handle.
void remove()
Removes the Task from the RTOS real time kernel's management.
std::uint32_t get_priority()
Gets the priority of the specified task.
void set_priority(std::uint32_t prio)
Sets the priority of the specified task.
std::uint32_t get_state()
Gets the state of the specified task.
void suspend()
Suspends the specified task, making it ineligible to be scheduled.
void resume()
Resumes the specified task, making it eligible to be scheduled.
const char* get_name()
Gets the name of the specified task.
std::uint32_t notify()
Sends a simple notification to task and increments the notification counter.
void join()
Utilizes task notifications to wait until specified task is complete and deleted, then continues to execute the program.
std::uint32_t notify_ext(std::uint32_t value, notify_action_e_t action, std::uint32_t* prev_value)
Sends a notification to a task, optionally performing some action.
bool notify_clear()
Clears the notification for a task.