summaryrefslogtreecommitdiffhomepage
path: root/digital/ai/src/utils/timer.h
diff options
context:
space:
mode:
authorNicolas Schodet2011-06-03 10:07:33 +0200
committerNicolas Schodet2012-05-14 20:38:39 +0200
commit4d737b1f6318db3014731fc2a2648997c2dfc03e (patch)
tree82798a6a9cb4b83741a12e99b621db23d7d6bb21 /digital/ai/src/utils/timer.h
parent7dde99ea828e9aaa6d53b54bf19d29d14b7ef625 (diff)
digital/ai/src/utils: use interrupt for timer
Use interrupt to avoid loosing any single timer tick.
Diffstat (limited to 'digital/ai/src/utils/timer.h')
-rw-r--r--digital/ai/src/utils/timer.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/digital/ai/src/utils/timer.h b/digital/ai/src/utils/timer.h
index e085b86e..dd71681f 100644
--- a/digital/ai/src/utils/timer.h
+++ b/digital/ai/src/utils/timer.h
@@ -52,17 +52,17 @@ void
timer_init (void);
/**
- * Wait until the timer overflows.
- * @return
- * - 0 if we are on time (we have not reached overflow before calling this
- * function).
- * - 1 if we have already reached overflow.
- * @warning if this function return 1, it means we are late and the main loop
- * is lasting more than the time configured. Consequence, some important
- * functions (like the chronometer for match duration) will not work
- * correctly!
+ * Wait until next tick. Return non zero if we are late.
+ *
+ * Warning: if this function return non zero, it means we are late and the
+ * main loop is lasting more than the time configured. Consequence: some
+ * important functions will not work correctly!
*/
uint8_t
timer_wait (void);
+/** Get a tick value, incremented at each tick, never reset. */
+uint8_t
+timer_get_tick (void);
+
#endif /* timer_h */