14#ifndef VEX_TASK_CLASS_H
15#define VEX_TASK_CLASS_H
34 int (* _callback)(void);
37 static int32_t _index(
int (* callback)(
void) );
38 static void _stopAll();
46 task(
int (* callback)(
void) );
55 static const int32_t taskPrioritylow = 1;
56 static const int32_t taskPriorityNormal = 7;
57 static const int32_t taskPriorityHigh = 15;
145 static void stop(
int (* callback)(
void) );
155 static bool _initialized;
Use this class to synchronize access to resources.
void lock()
Attempts to lock the semaphore. If the semaphore is previously locked, it will block until the semaph...
void unlock()
Unlocks a locked semaphore.
void lock(uint32_t time)
Attempts to lock the semaphore. If the semaphore is previously locked, it will block until the timeou...
bool owner()
Checks to see if the semaphore was locked and is owned by the current task.
Use this class to create and control tasks.
void suspend()
Suspends the task until the task is told to resume.
static void sleep(uint32_t time)
Sets the task to sleep for the specified amount of time (in milliseconds).
task(int(*callback)(void))
Constructs a task with a function callback.
void setPriority(uint16_t priority)
Sets the priority of the task.
static int16_t priority(const task &t)
Gets the priority of a task.
static void yield()
return control to the scheduler and allow other tasks to run.
task(int(*callback)(void), uint16_t priority)
Constructs a task with a function callback and a priority.
static void stop(const task &t)
Stops the specified task.
void resume()
Resumes the previously suspended task.
static void stop(int(*callback)(void))
Stops the task of the passed in function.
static void resume(const task &t)
Resumes a specified task that has been suspended.
int16_t index(void)
Gets the task's index.
static void dump()
, internal use
int16_t priority()
Gets the priority of the task.
static void suspend(const task &t)
Suspends the specified task for later use.
void stop()
Stops the task.
static void setPriority(const task &t, uint16_t priority)
Sets the priority of the specified task.
Bumper switch device class