From 4ca9e470a5bb7f5549358b301350bf0ff2498a55 Mon Sep 17 00:00:00 2001 From: Markus Hitter Date: Tue, 22 Feb 2011 21:06:44 +0100 Subject: [PATCH] Move timer macros from config.h.dist and derivates to timer.c. This sould confuse users less and neither value is subject to change per configuration. Reviewed also by Markus Amsler. --- config.gen3.h | 6 ------ config.gen6.h | 6 ------ config.h.dist | 6 ------ config.ramps.h | 6 ------ timer.c | 6 ++++++ 5 files changed, 6 insertions(+), 24 deletions(-) diff --git a/config.gen3.h b/config.gen3.h index 2cd846c..ac58e57 100644 --- a/config.gen3.h +++ b/config.gen3.h @@ -368,12 +368,6 @@ DEFINE_TEMP_SENSOR(noheater, TT_INTERCOM, 0) */ #define STEP_INTERRUPT_INTERRUPTIBLE 1 -/* - how often we overflow and update our clock; with F_CPU=16MHz, max is < 4.096ms (TICK_TIME = 65535) -*/ -#define TICK_TIME 2 MS -#define TICK_TIME_MS (TICK_TIME / (F_CPU / 1000)) - /* temperature history count. This is how many temperature readings to keep in order to calculate derivative in PID loop higher values make PID derivative term more stable at the expense of reaction time diff --git a/config.gen6.h b/config.gen6.h index e9a5004..29068f3 100644 --- a/config.gen6.h +++ b/config.gen6.h @@ -357,12 +357,6 @@ DEFINE_HEATER(extruder, PORTD, PIND6, OCR2B) */ #define STEP_INTERRUPT_INTERRUPTIBLE 1 -/* - how often we overflow and update our clock; with F_CPU=16MHz, max is < 4.096ms (TICK_TIME = 65535) -*/ -#define TICK_TIME 2 MS -#define TICK_TIME_MS (TICK_TIME / (F_CPU / 1000)) - /* temperature history count. This is how many temperature readings to keep in order to calculate derivative in PID loop higher values make PID derivative term more stable at the expense of reaction time diff --git a/config.h.dist b/config.h.dist index 36cc491..999cec9 100644 --- a/config.h.dist +++ b/config.h.dist @@ -385,12 +385,6 @@ DEFINE_HEATER(bed, PORTB, PINB4, OCR0B) */ #define STEP_INTERRUPT_INTERRUPTIBLE 1 -/* - how often we overflow and update our clock; with F_CPU=16MHz, max is < 4.096ms (TICK_TIME = 65535) -*/ -#define TICK_TIME 2 MS -#define TICK_TIME_MS (TICK_TIME / (F_CPU / 1000)) - /* temperature history count. This is how many temperature readings to keep in order to calculate derivative in PID loop higher values make PID derivative term more stable at the expense of reaction time diff --git a/config.ramps.h b/config.ramps.h index dcd719e..c159229 100644 --- a/config.ramps.h +++ b/config.ramps.h @@ -371,12 +371,6 @@ DEFINE_HEATER(fan, PORTH, PINH6, OCR2B) */ #define STEP_INTERRUPT_INTERRUPTIBLE 1 -/* - how often we overflow and update our clock; with F_CPU=16MHz, max is < 4.096ms (TICK_TIME = 65535) -*/ -#define TICK_TIME 2 MS -#define TICK_TIME_MS (TICK_TIME / (F_CPU / 1000)) - /* temperature history count. This is how many temperature readings to keep in order to calculate derivative in PID loop higher values make PID derivative term more stable at the expense of reaction time diff --git a/timer.c b/timer.c index 9481aed..fe60c65 100644 --- a/timer.c +++ b/timer.c @@ -4,6 +4,12 @@ #include "dda_queue.h" +/* + how often we overflow and update our clock; with F_CPU=16MHz, max is < 4.096ms (TICK_TIME = 65535) +*/ +#define TICK_TIME 2 MS +#define TICK_TIME_MS (TICK_TIME / (F_CPU / 1000)) + volatile uint32_t next_step_time; uint8_t clock_counter_10ms = 0;