ZestCode
 
Loading...
Searching...
No Matches
rtos.h File Reference
#include <stdbool.h>
#include <stdint.h>

Go to the source code of this file.

Macros

#define CURRENT_TASK   ((task_t)NULL)
 
Macros
#define TASK_PRIORITY_MAX   16
 
#define TASK_PRIORITY_MIN   1
 
#define TASK_PRIORITY_DEFAULT   8
 
#define TASK_STACK_DEPTH_DEFAULT   0x2000
 
#define TASK_STACK_DEPTH_MIN   0x200
 
#define TASK_NAME_MAX_LEN   32
 
#define TIMEOUT_MAX   ((uint32_t)0xffffffffUL)
 

Typedefs

Typedefs
typedef void * task_t
 
typedef void(* task_fn_t) (void *)
 
typedef void * mutex_t
 

Enumerations

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
}
 
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
}
 

Functions

uint32_t millis (void)
 
uint64_t micros (void)
 
task_t task_create (task_fn_t function, void *const parameters, uint32_t prio, const uint16_t stack_depth, const char *const name)
 
void task_delete (task_t task)
 
void task_delay (const uint32_t milliseconds)
 
void delay (const uint32_t milliseconds)
 
void task_delay_until (uint32_t *const prev_time, const uint32_t delta)
 
uint32_t task_get_priority (task_t task)
 
void task_set_priority (task_t task, uint32_t prio)
 
task_state_e_t task_get_state (task_t task)
 
void task_suspend (task_t task)
 
void task_resume (task_t task)
 
uint32_t task_get_count (void)
 
char * task_get_name (task_t task)
 
task_t task_get_by_name (const char *name)
 
task_t task_get_current ()
 
uint32_t task_notify (task_t task)
 
void task_join (task_t task)
 
uint32_t task_notify_ext (task_t task, uint32_t value, notify_action_e_t action, uint32_t *prev_value)
 
uint32_t task_notify_take (bool clear_on_exit, uint32_t timeout)
 
bool task_notify_clear (task_t task)
 
mutex_t mutex_create (void)
 
bool mutex_take (mutex_t mutex, uint32_t timeout)
 
bool mutex_give (mutex_t mutex)
 
mutex_t mutex_recursive_create (void)
 
bool mutex_recursive_take (mutex_t mutex, uint32_t timeout)
 
bool mutex_recursive_give (mutex_t mutex)
 
void mutex_delete (mutex_t mutex)
 

Detailed Description

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://mozilla.org/MPL/2.0/.