#include <aversive.h>
Go to the source code of this file.
Data Structures | |
struct | time_h |
Typedefs | |
typedef int32_t | seconds |
typedef int32_t | microseconds |
Functions | |
void | time_init (uint8_t priority) |
seconds | time_get_s (void) |
microseconds | time_get_us (void) |
time_h | time_get_time (void) |
void | time_reset (void) |
void | time_set (seconds s, microseconds us) |
void | time_wait_ms (uint16_t ms) |
microseconds | time_get_us2 (void) |
typedef int32_t microseconds |
typedef int32_t seconds |
seconds time_get_s | ( | void | ) |
time_h time_get_time | ( | void | ) |
get the complete time struct since last init/reset
Definition at line 103 of file time.c.
References IRQ_LOCK, and IRQ_UNLOCK.
microseconds time_get_us | ( | void | ) |
get time in microsecond since last init/reset
Definition at line 79 of file time.c.
References IRQ_LOCK, IRQ_UNLOCK, and time_h::us.
microseconds time_get_us2 | ( | void | ) |
get a microsecond timer that overflows naturally
Definition at line 91 of file time.c.
References IRQ_LOCK, and IRQ_UNLOCK.
Referenced by time_wait_ms().
void time_init | ( | uint8_t | priority | ) |
init time module : schedule the event with the givent priority
Definition at line 58 of file time.c.
References NB_SCHEDULER_UNIT_NOT_NULL, time_increment(), and time_reset().
Referenced by main().
void time_reset | ( | void | ) |
reset time counter
Definition at line 115 of file time.c.
References IRQ_LOCK, IRQ_UNLOCK, time_h::s, and time_h::us.
Referenced by time_init().
void time_set | ( | seconds | s, | |
microseconds | us | |||
) |
set time
Definition at line 126 of file time.c.
References IRQ_LOCK, IRQ_UNLOCK, time_h::s, and time_h::us.
void time_wait_ms | ( | uint16_t | ms | ) |
This is an equivalent of 'wait_ms(x)', but uses time value, so it is independant of CPU load. Warning, you should not use this function in a irq locked context, or in a scheduled function with higher priority than time module
Definition at line 137 of file time.c.
References time_get_us2().
Referenced by test_sched().