summaryrefslogtreecommitdiff
path: root/timer.h
diff options
context:
space:
mode:
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 0000000000..8ddf9e7e28
--- /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