From 4d737b1f6318db3014731fc2a2648997c2dfc03e Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Fri, 3 Jun 2011 10:07:33 +0200 Subject: digital/ai/src/utils: use interrupt for timer Use interrupt to avoid loosing any single timer tick. --- digital/ai/src/utils/timer.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'digital/ai/src/utils/timer.h') 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 */ -- cgit v1.2.3