timer.c/.h: make TICK_TIME macros available globally.

This commit is contained in:
Markus Hitter 2013-10-20 15:20:01 +02:00
parent 59599a3552
commit da5c29a7dd
2 changed files with 8 additions and 6 deletions

View File

@ -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;

View File

@ -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
*/