timer.c/.h: make TICK_TIME macros available globally.
This commit is contained in:
parent
59599a3552
commit
da5c29a7dd
6
timer.c
6
timer.c
|
|
@ -20,12 +20,6 @@
|
||||||
#include "dda_queue.h"
|
#include "dda_queue.h"
|
||||||
#endif
|
#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
|
/// time until next step, as output compare register is too small for long step times
|
||||||
uint32_t next_step_time;
|
uint32_t next_step_time;
|
||||||
|
|
||||||
|
|
|
||||||
8
timer.h
8
timer.h
|
|
@ -8,6 +8,14 @@
|
||||||
#define US * (F_CPU / 1000000)
|
#define US * (F_CPU / 1000000)
|
||||||
#define MS * (F_CPU / 1000)
|
#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
|
clock stuff
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue