From 45d4a7a89883c3433604d4e011b665796a583008 Mon Sep 17 00:00:00 2001 From: tmk Date: Fri, 29 Oct 2010 15:17:18 +0900 Subject: improve layer switching --- timer.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 timer.h (limited to 'timer.h') diff --git a/timer.h b/timer.h new file mode 100644 index 000000000..8ddf9e7e2 --- /dev/null +++ b/timer.h @@ -0,0 +1,17 @@ +#ifndef TIMER_H +#define TIMER_H 1 + +#include + +#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 -- cgit v1.2.3