The real-time module handles the scheduling and execution of real-time tasks (with predictable execution times).
◆ RTIMER_CLOCK_LT
#define RTIMER_CLOCK_LT |
( |
|
a, |
|
|
|
b |
|
) |
| ((signed short)((a)-(b)) < 0) |
◆ RTIMER_NOW
Get the current clock time.
- Returns
- The current time
This function returns what the real-time module thinks
is the current time. The current time is used to set
the timeouts for real-time tasks.
◆ RTIMER_SECOND
◆ RTIMER_TIME
#define RTIMER_TIME |
( |
|
task | ) |
|
Get the time that a task last was executed.
- Parameters
-
- Returns
- The time that a task last was executed
This function returns the time that the task was last
executed. This typically is used to get a periodic
execution of a task without clock drift.
◆ rtimer_callback_t
typedef void(* rtimer_callback_t) (struct rtimer *t, void *ptr) |
◆ rtimer_clock_t
◆ anonymous enum
Enumerator |
---|
RTIMER_OK | |
RTIMER_ERR_FULL | |
RTIMER_ERR_TIME | |
RTIMER_ERR_ALREADY_SCHEDULED | |
◆ rtimer_arch_init()
void rtimer_arch_init |
( |
void |
| ) |
|
◆ rtimer_arch_schedule()
◆ rtimer_init()
void rtimer_init |
( |
void |
| ) |
|
Initialize the real-time scheduler.
This function initializes the real-time scheduler and
must be called at boot-up, before any other functions
from the real-time scheduler is called.
◆ rtimer_run_next()
void rtimer_run_next |
( |
void |
| ) |
|
Execute the next real-time task and schedule the next task, if any.
This function is called by the architecture dependent
code to execute and schedule the next real-time task.
◆ rtimer_set()
Post a real-time task.
- Parameters
-
task | A pointer to the task variable previously declared with RTIMER_TASK(). |
time | The time when the task is to be executed. |
duration | Unused argument. |
func | A function to be called when the task is executed. |
ptr | An opaque pointer that will be supplied as an argument to the callback function. |
- Returns
- Non-zero (true) if the task could be scheduled, zero (false) if the task could not be scheduled.
This function schedules a real-time task at a specified time in the future.