From da5c29a7ddbdb4c66f4dd90361f8ea73b887acee Mon Sep 17 00:00:00 2001 From: Markus Hitter Date: Sun, 20 Oct 2013 15:20:01 +0200 Subject: [PATCH] timer.c/.h: make TICK_TIME macros available globally. --- timer.c | 6 ------ timer.h | 8 ++++++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/timer.c b/timer.c index be0f7f5..934eb93 100644 --- a/timer.c +++ b/timer.c @@ -20,12 +20,6 @@ #include "dda_queue.h" #endif - -/// how often we overflow and update our clock; with F_CPU=16MHz, max is < 4.096ms (TICK_TIME = 65535) -#define TICK_TIME 2 MS -/// convert back to ms from cpu ticks so our system clock runs properly if you change TICK_TIME -#define TICK_TIME_MS (TICK_TIME / (F_CPU / 1000)) - /// time until next step, as output compare register is too small for long step times uint32_t next_step_time; diff --git a/timer.h b/timer.h index 9edc71b..b28f9b0 100644 --- a/timer.h +++ b/timer.h @@ -8,6 +8,14 @@ #define US * (F_CPU / 1000000) #define MS * (F_CPU / 1000) +/// How often we overflow and update our clock. +/// With F_CPU = 16MHz, max is < 4.096ms (TICK_TIME = 65535). +#define TICK_TIME 2 MS + +/// Convert back to ms from cpu ticks so our system clock runs +/// properly if you change TICK_TIME. +#define TICK_TIME_MS (TICK_TIME / (F_CPU / 1000)) + /* clock stuff */