file
rtos.hContents
- Reference
Contains declarations for the PROS RTOS kernel for use by typical VEX programmers.
This file should not be modified by users, since it gets replaced whenever a kernel upgrade occurs.
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http:/
Namespaces
Functions
- uint32_t millis(void)
- Gets the number of milliseconds since PROS initialized.
- uint64_t micros(void)
- Gets the number of microseconds since PROS initialized,.
-
task_
t task_create(task_ fn_ t function, void*const parameters, uint32_t prio, const uint16_t stack_depth, const char*const name) - Creates a new task and add it to the list of tasks that are ready to run.
-
void task_delete(task_
t task) - Removes a task from the RTOS real time kernel's management.
- void task_delay(const uint32_t milliseconds)
- Delays the current task for a given number of milliseconds.
- void delay(const uint32_t milliseconds)
- Delays the current task for a given number of milliseconds.
- void task_delay_until(uint32_t*const prev_time, const uint32_t delta)
- Delays the current task until a specified time.
-
uint32_t task_get_priority(task_
t task) - Gets the priority of the specified task.
-
void task_set_priority(task_
t task, uint32_t prio) - Sets the priority of the specified task.
-
task_state_e_t task_get_state(task_
t task) - Gets the state of the specified task.
-
void task_suspend(task_
t task) - Suspends the specified task, making it ineligible to be scheduled.
-
void task_resume(task_
t task) - Resumes the specified task, making it eligible to be scheduled.
- uint32_t task_get_count(void)
- Gets the number of tasks the kernel is currently managing, including all ready, blocked, or suspended tasks.
-
char* task_get_name(task_
t task) - Gets the name of the specified task.
-
task_
t task_get_by_name(const char* name) - Gets a task handle from the specified name.
-
task_
t task_get_current() - Get the currently running task handle.
-
uint32_t task_notify(task_
t task) - Sends a simple notification to task and increments the notification counter.
-
void task_join(task_
t task) - Utilizes task notifications to wait until specified task is complete and deleted, then continues to execute the program.
-
uint32_t task_notify_ext(task_
t task, uint32_t value, notify_action_e_t action, uint32_t* prev_value) - Sends a notification to a task, optionally performing some action.
- uint32_t task_notify_take(bool clear_on_exit, uint32_t timeout)
- Waits for a notification to be nonzero.
-
bool task_notify_clear(task_
t task) - Clears the notification for a task.
-
mutex_
t mutex_create(void) - Creates a mutex.
-
bool mutex_take(mutex_
t mutex, uint32_t timeout) - Takes and locks a mutex, waiting for up to a certain number of milliseconds before timing out.
-
bool mutex_give(mutex_
t mutex) - Unlocks a mutex.
-
void mutex_delete(mutex_
t mutex) - Deletes a mutex.
Macros
- #define TASK_PRIORITY_MAX
- The highest priority that can be assigned to a task.
- #define TASK_PRIORITY_MIN
- The lowest priority that can be assigned to a task.
- #define TASK_PRIORITY_DEFAULT
- The default task priority, which should be used for most tasks unless you have a specific need for a higher or lower priority task.
- #define TASK_STACK_DEPTH_DEFAULT
- The recommended stack size for a new task.
- #define TASK_STACK_DEPTH_MIN
- The minimal stack size for a task.
- #define TASK_NAME_MAX_LEN
- The maximum number of characters allowed in a task's name.
- #define TIMEOUT_MAX
- The maximum timeout value that can be given to, for instance, a mutex grab.
Typedefs
Enumerations
- enum task_state_e_t { E_TASK_STATE_RUNNING = 0, E_TASK_STATE_READY, E_TASK_STATE_BLOCKED, E_TASK_STATE_SUSPENDED, E_TASK_STATE_DELETED, E_TASK_STATE_INVALID }
- The state of a task.
- enum notify_action_e_t { E_NOTIFY_ACTION_NONE, E_NOTIFY_ACTION_BITS, E_NOTIFY_ACTION_INCR, E_NOTIFY_ACTION_OWRITE, E_NOTIFY_ACTION_NO_OWRITE }
- brief The action to take when a task is notified.
Defines
- #define CURRENT_TASK
- The task handle of the currently running task.