浏览代码

Fixed temperature reading bug.

(When using the lower and upper adc input bank)
Erik van der Zalm 13 年前
父节点
当前提交
dd5296ad4d
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6
    0
      Marlin/temperature.cpp

+ 6
- 0
Marlin/temperature.cpp 查看文件

@@ -464,6 +464,8 @@ ISR(TIMER0_COMPB_vect)
464 464
       #if (TEMP_0_PIN > -1)
465 465
         #if TEMP_0_PIN > 7
466 466
           ADCSRB = 1<<MUX5;
467
+        #else
468
+          ADCSRB = 0;
467 469
         #endif
468 470
         ADMUX = ((1 << REFS0) | (TEMP_0_PIN & 0x07));
469 471
         ADCSRA |= 1<<ADSC; // Start conversion
@@ -483,6 +485,8 @@ ISR(TIMER0_COMPB_vect)
483 485
       #if (TEMP_1_PIN > -1)
484 486
         #if TEMP_1_PIN > 7
485 487
           ADCSRB = 1<<MUX5;
488
+        #else
489
+          ADCSRB = 0;
486 490
         #endif
487 491
         ADMUX = ((1 << REFS0) | (TEMP_1_PIN & 0x07));
488 492
         ADCSRA |= 1<<ADSC; // Start conversion
@@ -502,6 +506,8 @@ ISR(TIMER0_COMPB_vect)
502 506
       #if (TEMP_2_PIN > -1)
503 507
         #if TEMP_2_PIN > 7
504 508
           ADCSRB = 1<<MUX5;
509
+        #else
510
+          ADCSRB = 0;
505 511
         #endif
506 512
         ADMUX = ((1 << REFS0) | (TEMP_2_PIN & 0x07));
507 513
         ADCSRA |= 1<<ADSC; // Start conversion

正在加载...
取消
保存