Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed temperature reading bug.
(When using the lower and upper adc input bank)
  • Loading branch information
ErikZalm committed Nov 28, 2011
1 parent f75f426 commit dd5296a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Marlin/temperature.cpp
Expand Up @@ -464,6 +464,8 @@ ISR(TIMER0_COMPB_vect)
#if (TEMP_0_PIN > -1)
#if TEMP_0_PIN > 7
ADCSRB = 1<<MUX5;
#else
ADCSRB = 0;
#endif
ADMUX = ((1 << REFS0) | (TEMP_0_PIN & 0x07));
ADCSRA |= 1<<ADSC; // Start conversion
Expand All @@ -483,6 +485,8 @@ ISR(TIMER0_COMPB_vect)
#if (TEMP_1_PIN > -1)
#if TEMP_1_PIN > 7
ADCSRB = 1<<MUX5;
#else
ADCSRB = 0;
#endif
ADMUX = ((1 << REFS0) | (TEMP_1_PIN & 0x07));
ADCSRA |= 1<<ADSC; // Start conversion
Expand All @@ -502,6 +506,8 @@ ISR(TIMER0_COMPB_vect)
#if (TEMP_2_PIN > -1)
#if TEMP_2_PIN > 7
ADCSRB = 1<<MUX5;
#else
ADCSRB = 0;
#endif
ADMUX = ((1 << REFS0) | (TEMP_2_PIN & 0x07));
ADCSRA |= 1<<ADSC; // Start conversion
Expand Down

0 comments on commit dd5296a

Please sign in to comment.