You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
286 B
18 lines
286 B
14 years ago
|
#ifndef TIMER_H
|
||
|
#define TIMER_H 1
|
||
|
|
||
|
#include <stdint.h>
|
||
|
|
||
|
#define TIMER_DIFF(a, b) ((a) >= (b) ? (a) - (b) : UINT16_MAX - (b) + (a))
|
||
|
|
||
|
|
||
|
extern uint16_t timer_count;
|
||
|
|
||
|
|
||
|
void timer_init(void);
|
||
|
void timer_clear(void);
|
||
|
uint16_t timer_read(void);
|
||
|
uint16_t timer_elapsed(uint16_t last);
|
||
|
|
||
|
#endif
|