2010-10-29 08:17:18 +02:00
|
|
|
#ifndef TIMER_H
|
|
|
|
#define TIMER_H 1
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#define TIMER_DIFF(a, b) ((a) >= (b) ? (a) - (b) : UINT16_MAX - (b) + (a))
|
|
|
|
|
|
|
|
|
2011-01-28 16:44:05 +01:00
|
|
|
extern volatile uint16_t timer_count;
|
2010-10-29 08:17:18 +02:00
|
|
|
|
|
|
|
|
|
|
|
void timer_init(void);
|
|
|
|
void timer_clear(void);
|
|
|
|
uint16_t timer_read(void);
|
|
|
|
uint16_t timer_elapsed(uint16_t last);
|
|
|
|
|
|
|
|
#endif
|