From bcd47e90b007d135e04be3a2a4732196ad8a751a Mon Sep 17 00:00:00 2001 From: Markus Amsler Date: Mon, 14 Feb 2011 18:32:00 +0100 Subject: [PATCH] Fix analog reading of channel 0 if another channel is active. --- analog.c | 7 +++++-- extruder/analog.c | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/analog.c b/analog.c index d3e36de..ff5b03d 100644 --- a/analog.c +++ b/analog.c @@ -9,7 +9,10 @@ uint8_t adc_running_mask, adc_counter; -#if ANALOG_MASK & 2 +#if ANALOG_MASK & 1 + #define ANALOG_START 0 + #define ANALOG_START_MASK 1 +#elif ANALOG_MASK & 2 #define ANALOG_START 1 #define ANALOG_START_MASK 2 #elif ANALOG_MASK & 4 @@ -31,7 +34,7 @@ uint8_t adc_running_mask, adc_counter; #define ANALOG_START 7 #define ANALOG_START_MASK 128 #else - // ANALOG_MASK == 1 or 0, either way defines are the same except they're not used if ANALOG_MASK == 0 + // ANALOG_MASK == 0 #define ANALOG_START 0 #define ANALOG_START_MASK 1 #endif diff --git a/extruder/analog.c b/extruder/analog.c index e4aebbb..c6d7c5e 100644 --- a/extruder/analog.c +++ b/extruder/analog.c @@ -9,7 +9,10 @@ uint8_t adc_running_mask, adc_counter; -#if ANALOG_MASK & 2 +#if ANALOG_MASK & 1 + #define ANALOG_START 0 + #define ANALOG_START_MASK 1 +#elif ANALOG_MASK & 2 #define ANALOG_START 1 #define ANALOG_START_MASK 2 #elif ANALOG_MASK & 4 @@ -31,7 +34,7 @@ uint8_t adc_running_mask, adc_counter; #define ANALOG_START 7 #define ANALOG_START_MASK 128 #else - // ANALOG_MASK == 1 or 0, either way defines are the same except they're not used if ANALOG_MASK == 0 + // ANALOG_MASK == 0 #define ANALOG_START 0 #define ANALOG_START_MASK 1 #endif