Skip to content

Commit

Permalink
Fix analog reading of channel 0 if another channel is active.
Browse files Browse the repository at this point in the history
  • Loading branch information
amsler authored and triffid committed Feb 15, 2011
1 parent e41e659 commit b0d1ba0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions analog.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
7 changes: 5 additions & 2 deletions extruder/analog.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit b0d1ba0

Please sign in to comment.