summaryrefslogtreecommitdiff
path: root/timer.h
diff options
context:
space:
mode:
authortmk2010-10-29 15:17:18 +0900
committertmk2010-10-30 01:16:47 +0900
commit45d4a7a89883c3433604d4e011b665796a583008 (patch)
treeb9ff5306dc5eb9a06d7e4a2fb7d0873a9b30606d /timer.h
parent6c3b9a2ded1afcf4a6bbc69878f52088f4c1a0e8 (diff)
improve layer switching
Diffstat (limited to 'timer.h')
-rw-r--r--timer.h17
1 files changed, 17 insertions, 0 deletions
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 <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