Use this class to create and control tasks.
More...
#include <vex_task.h>
|
| task (int(*callback)(void)) |
| Constructs a task with a function callback.
|
|
| task (int(*callback)(void), uint16_t priority) |
| Constructs a task with a function callback and a priority.
|
|
void | stop () |
| Stops the task.
|
|
void | suspend () |
| Suspends the task until the task is told to resume.
|
|
void | resume () |
| Resumes the previously suspended task.
|
|
int16_t | priority () |
| Gets the priority of the task.
|
|
void | setPriority (uint16_t priority) |
| Sets the priority of the task.
|
|
int16_t | index (void) |
| Gets the task's index.
|
|
|
static void | stop (const task &t) |
| Stops the specified task.
|
|
static void | suspend (const task &t) |
| Suspends the specified task for later use.
|
|
static void | resume (const task &t) |
| Resumes a specified task that has been suspended.
|
|
static int16_t | priority (const task &t) |
| Gets the priority of a task.
|
|
static void | setPriority (const task &t, uint16_t priority) |
| Sets the priority of the specified task.
|
|
static void | sleep (uint32_t time) |
| Sets the task to sleep for the specified amount of time (in milliseconds).
|
|
static void | yield () |
| return control to the scheduler and allow other tasks to run.
|
|
static void | dump () |
| , internal use
|
|
static void | stop (int(*callback)(void)) |
| Stops the task of the passed in function.
|
|
|
static int32_t | _index (int(*callback)(void)) |
|
static void | _stopAll () |
|
Use this class to create and control tasks.
Definition at line 31 of file vex_task.h.
◆ task() [1/2]
vex::task::task |
( |
int(* | callback )(void) | ) |
|
Constructs a task with a function callback.
- Parameters
-
callback | A reference to a function. |
◆ task() [2/2]
vex::task::task |
( |
int(* | callback )(void), |
|
|
uint16_t | priority ) |
Constructs a task with a function callback and a priority.
- Parameters
-
callback | A reference to a function. |
priority | Sets the priority of the task. |
◆ index()
int16_t vex::task::index |
( |
void | | ) |
|
Gets the task's index.
- Returns
- Returns an integer that represents the index of the task.
◆ priority() [1/2]
int16_t vex::task::priority |
( |
| ) |
|
Gets the priority of the task.
- Returns
- Returns an integer that represents the priority of the task.
◆ priority() [2/2]
static int16_t vex::task::priority |
( |
const task & | t | ) |
|
|
static |
Gets the priority of a task.
- Returns
- Returns an integer that represents the current priority of the specified task.
- Parameters
-
t | The task to get priority of. |
◆ resume()
static void vex::task::resume |
( |
const task & | t | ) |
|
|
static |
Resumes a specified task that has been suspended.
- Parameters
-
◆ setPriority() [1/2]
static void vex::task::setPriority |
( |
const task & | t, |
|
|
uint16_t | priority ) |
|
static |
Sets the priority of the specified task.
- Parameters
-
t | The task to set the priority on. |
priority | The priority level of a task. |
◆ setPriority() [2/2]
void vex::task::setPriority |
( |
uint16_t | priority | ) |
|
Sets the priority of the task.
- Parameters
-
priority | The priority level of the task. |
◆ sleep()
static void vex::task::sleep |
( |
uint32_t | time | ) |
|
|
static |
Sets the task to sleep for the specified amount of time (in milliseconds).
- Parameters
-
time | The number of milliseconds for the task to sleep. |
◆ stop() [1/2]
static void vex::task::stop |
( |
const task & | t | ) |
|
|
static |
Stops the specified task.
- Parameters
-
◆ stop() [2/2]
static void vex::task::stop |
( |
int(* | callback )(void) | ) |
|
|
static |
Stops the task of the passed in function.
- Parameters
-
callback | A reference to a function. |
◆ suspend()
static void vex::task::suspend |
( |
const task & | t | ) |
|
|
static |
Suspends the specified task for later use.
- Parameters
-
t | The task to be suspended. |
◆ taskPriorityHigh
const int32_t vex::task::taskPriorityHigh = 15 |
|
static |
◆ taskPrioritylow
const int32_t vex::task::taskPrioritylow = 1 |
|
static |
◆ taskPriorityNormal
const int32_t vex::task::taskPriorityNormal = 7 |
|
static |
The documentation for this class was generated from the following file: