xyControl
0.1
Quadrotor Flight Controller on AVR Basis
|
Measuring Time with Millisecond Resolution. More...
Files | |
file | time.h |
Time API Header. | |
file | time.c |
Time API Implementation. | |
Macros | |
#define | TCRA TCCR2A |
Timer 2 Control Register A. More... | |
#define | TCRB TCCR2B |
Timer 2 Control Register B. More... | |
#define | OCR OCR2A |
Timer 2 Compare Register A. More... | |
#define | TIMS TIMSK2 |
Timer 2 Interrupt Mask. More... | |
#define | OCIE OCIE2A |
Timer 2 Compare Match A Interrupt Enable. More... | |
Typedefs | |
typedef uint64_t | time_t |
Timekeeping Data Type. More... | |
Functions | |
void | initSystemTimer (void) |
Initialize the system timer. More... | |
time_t | getSystemTime (void) |
Get the System Uptime. More... | |
ISR (TIMER2_COMPA_vect) | |
Timer 2 Compare Match A Interrupt. More... | |
Variables | |
volatile time_t | systemTime = 0 |
Current System Uptime. More... | |
Measuring Time with Millisecond Resolution.
Uses Timer 2
Prescaler 64
Count to 250
16000000 / 64 / 250 = 1000 –> 1 Interrupt per millisecond
typedef uint64_t time_t |
time_t getSystemTime | ( | void | ) |
Get the System Uptime.
Definition at line 68 of file time.c.
References systemTime.
Referenced by complementaryExecute(), complementaryInit(), orientationTask(), and pidExecute().
void initSystemTimer | ( | void | ) |
ISR | ( | TIMER2_COMPA_vect | ) |
volatile time_t systemTime = 0 |
Current System Uptime.
Definition at line 47 of file time.c.
Referenced by getSystemTime(), and ISR().