소스 검색

Additional temp-oriented improvements

Scott Lahteine 6 년 전
부모
커밋
81b632c255
5개의 변경된 파일171개의 추가작업 그리고 164개의 파일을 삭제
  1. 15
    15
      Marlin/src/HAL/HAL_STM32F1/HAL.cpp
  2. 45
    28
      Marlin/src/inc/Conditionals_post.h
  3. 31
    31
      Marlin/src/lcd/ultralcd.cpp
  4. 75
    85
      Marlin/src/module/temperature.cpp
  5. 5
    5
      Marlin/src/module/temperature.h

+ 15
- 15
Marlin/src/HAL/HAL_STM32F1/HAL.cpp 파일 보기

@@ -101,19 +101,19 @@ uint16_t HAL_adc_result;
101 101
 STM32ADC adc(ADC1);
102 102
 
103 103
 uint8 adc_pins[] = {
104
-  #if HAS_TEMP_0
104
+  #if HAS_TEMP_ADC_0
105 105
     TEMP_0_PIN,
106 106
   #endif
107
-  #if HAS_TEMP_1
107
+  #if HAS_TEMP_ADC_1
108 108
     TEMP_1_PIN
109 109
   #endif
110
-  #if HAS_TEMP_2
110
+  #if HAS_TEMP_ADC_2
111 111
     TEMP_2_PIN,
112 112
   #endif
113
-  #if HAS_TEMP_3
113
+  #if HAS_TEMP_ADC_3
114 114
     TEMP_3_PIN,
115 115
   #endif
116
-  #if HAS_TEMP_4
116
+  #if HAS_TEMP_ADC_4
117 117
     TEMP_4_PIN,
118 118
   #endif
119 119
   #if HAS_HEATED_BED
@@ -125,19 +125,19 @@ uint8 adc_pins[] = {
125 125
 };
126 126
 
127 127
 enum TEMP_PINS : char {
128
-  #if HAS_TEMP_0
128
+  #if HAS_TEMP_ADC_0
129 129
     TEMP_0,
130 130
   #endif
131
-  #if HAS_TEMP_1
131
+  #if HAS_TEMP_ADC_1
132 132
     TEMP_1,
133 133
   #endif
134
-  #if HAS_TEMP_2
134
+  #if HAS_TEMP_ADC_2
135 135
     TEMP_2,
136 136
   #endif
137
-  #if HAS_TEMP_3
137
+  #if HAS_TEMP_ADC_3
138 138
     TEMP_3,
139 139
   #endif
140
-  #if HAS_TEMP_4
140
+  #if HAS_TEMP_ADC_4
141 141
     TEMP_4,
142 142
   #endif
143 143
   #if HAS_HEATED_BED
@@ -247,19 +247,19 @@ void HAL_adc_init(void) {
247 247
 void HAL_adc_start_conversion(const uint8_t adc_pin) {
248 248
   TEMP_PINS pin_index;
249 249
   switch (adc_pin) {
250
-    #if HAS_TEMP_0
250
+    #if HAS_TEMP_ADC_0
251 251
       case TEMP_0_PIN: pin_index = TEMP_0; break;
252 252
     #endif
253
-    #if HAS_TEMP_1
253
+    #if HAS_TEMP_ADC_1
254 254
       case TEMP_1_PIN: pin_index = TEMP_1; break;
255 255
     #endif
256
-    #if HAS_TEMP_2
256
+    #if HAS_TEMP_ADC_2
257 257
       case TEMP_2_PIN: pin_index = TEMP_2; break;
258 258
     #endif
259
-    #if HAS_TEMP_3
259
+    #if HAS_TEMP_ADC_3
260 260
       case TEMP_3_PIN: pin_index = TEMP_3; break;
261 261
     #endif
262
-    #if HAS_TEMP_4
262
+    #if HAS_TEMP_ADC_4
263 263
       case TEMP_4_PIN: pin_index = TEMP_4; break;
264 264
     #endif
265 265
     #if HAS_HEATED_BED

+ 45
- 28
Marlin/src/inc/Conditionals_post.h 파일 보기

@@ -328,8 +328,10 @@
328 328
 
329 329
 #if TEMP_SENSOR_1 == -4
330 330
   #define HEATER_1_USES_AD8495
331
-#elif TEMP_SENSOR_1 <= -2
332
-  #error "MAX6675 / MAX31855 Thermocouples not supported for TEMP_SENSOR_1"
331
+#elif TEMP_SENSOR_1 == -3
332
+  #error "MAX31855 Thermocouples not supported for TEMP_SENSOR_1"
333
+#elif TEMP_SENSOR_1 == -2
334
+  #error "MAX6675 Thermocouples not supported for TEMP_SENSOR_1"
333 335
 #elif TEMP_SENSOR_1 == -1
334 336
   #define HEATER_1_USES_AD595
335 337
 #elif TEMP_SENSOR_1 == 0
@@ -342,8 +344,10 @@
342 344
 
343 345
 #if TEMP_SENSOR_2 == -4
344 346
   #define HEATER_2_USES_AD8495
345
-#elif TEMP_SENSOR_2 <= -2
346
-  #error "MAX6675 / MAX31855 Thermocouples not supported for TEMP_SENSOR_2"
347
+#elif TEMP_SENSOR_2 == -3
348
+  #error "MAX31855 Thermocouples not supported for TEMP_SENSOR_2"
349
+#elif TEMP_SENSOR_2 == -2
350
+  #error "MAX6675 Thermocouples not supported for TEMP_SENSOR_2"
347 351
 #elif TEMP_SENSOR_2 == -1
348 352
   #define HEATER_2_USES_AD595
349 353
 #elif TEMP_SENSOR_2 == 0
@@ -356,8 +360,10 @@
356 360
 
357 361
 #if TEMP_SENSOR_3 == -4
358 362
   #define HEATER_3_USES_AD8495
359
-#elif TEMP_SENSOR_3 <= -2
360
-  #error "MAX6675 / MAX31855 Thermocouples not supported for TEMP_SENSOR_3"
363
+#elif TEMP_SENSOR_3 == -3
364
+  #error "MAX31855 Thermocouples not supported for TEMP_SENSOR_3"
365
+#elif TEMP_SENSOR_3 == -2
366
+  #error "MAX6675 Thermocouples not supported for TEMP_SENSOR_3"
361 367
 #elif TEMP_SENSOR_3 == -1
362 368
   #define HEATER_3_USES_AD595
363 369
 #elif TEMP_SENSOR_3 == 0
@@ -370,8 +376,10 @@
370 376
 
371 377
 #if TEMP_SENSOR_4 == -4
372 378
   #define HEATER_4_USES_AD8495
373
-#elif TEMP_SENSOR_4 <= -2
374
-  #error "MAX6675 / MAX31855 Thermocouples not supported for TEMP_SENSOR_4"
379
+#elif TEMP_SENSOR_4 == -3
380
+  #error "MAX31855 Thermocouples not supported for TEMP_SENSOR_4"
381
+#elif TEMP_SENSOR_4 == -2
382
+  #error "MAX6675 Thermocouples not supported for TEMP_SENSOR_4"
375 383
 #elif TEMP_SENSOR_4 == -1
376 384
   #define HEATER_4_USES_AD595
377 385
 #elif TEMP_SENSOR_4 == 0
@@ -384,8 +392,10 @@
384 392
 
385 393
 #if TEMP_SENSOR_BED == -4
386 394
   #define BED_USES_AD8495
387
-#elif TEMP_SENSOR_BED <= -2
388
-  #error "MAX6675 / MAX31855 Thermocouples not supported for TEMP_SENSOR_BED"
395
+#elif TEMP_SENSOR_BED == -3
396
+  #error "MAX31855 Thermocouples not supported for TEMP_SENSOR_BED"
397
+#elif TEMP_SENSOR_BED == -2
398
+  #error "MAX6675 Thermocouples not supported for TEMP_SENSOR_BED"
389 399
 #elif TEMP_SENSOR_BED == -1
390 400
   #define BED_USES_AD595
391 401
 #elif TEMP_SENSOR_BED == 0
@@ -398,8 +408,10 @@
398 408
 
399 409
 #if TEMP_SENSOR_CHAMBER == -4
400 410
   #define CHAMBER_USES_AD8495
401
-#elif TEMP_SENSOR_CHAMBER <= -2
402
-  #error "MAX6675 / MAX31855 Thermocouples not supported for TEMP_SENSOR_CHAMBER"
411
+#elif TEMP_SENSOR_CHAMBER == -3
412
+  #error "MAX31855 Thermocouples not supported for TEMP_SENSOR_CHAMBER"
413
+#elif TEMP_SENSOR_CHAMBER == -2
414
+  #error "MAX6675 Thermocouples not supported for TEMP_SENSOR_CHAMBER"
403 415
 #elif TEMP_SENSOR_CHAMBER == -1
404 416
   #define CHAMBER_USES_AD595
405 417
 #elif TEMP_SENSOR_CHAMBER > 0
@@ -407,10 +419,10 @@
407 419
   #define CHAMBER_USES_THERMISTOR
408 420
 #endif
409 421
 
410
-#define HEATER_USES_AD8495 (ENABLED(HEATER_0_USES_AD8495) || ENABLED(HEATER_1_USES_AD8495) || ENABLED(HEATER_2_USES_AD8495) || ENABLED(HEATER_3_USES_AD8495))
422
+#define HEATER_USES_AD8495 (ENABLED(HEATER_0_USES_AD8495) || ENABLED(HEATER_1_USES_AD8495) || ENABLED(HEATER_2_USES_AD8495) || ENABLED(HEATER_3_USES_AD8495) || ENABLED(HEATER_4_USES_AD8495))
411 423
 
412 424
 #ifdef __SAM3X8E__
413
-  #define HEATER_USES_AD595 (ENABLED(HEATER_0_USES_AD595) || ENABLED(HEATER_1_USES_AD595) || ENABLED(HEATER_2_USES_AD595) || ENABLED(HEATER_3_USES_AD595))
425
+  #define HEATER_USES_AD595 (ENABLED(HEATER_0_USES_AD595) || ENABLED(HEATER_1_USES_AD595) || ENABLED(HEATER_2_USES_AD595) || ENABLED(HEATER_3_USES_AD595) || ENABLED(HEATER_4_USES_AD595))
414 426
 #endif
415 427
 
416 428
 /**
@@ -746,12 +758,13 @@
746 758
 #endif
747 759
 
748 760
 // Endstops and bed probe
749
-#define HAS_X_MIN (PIN_EXISTS(X_MIN) && !IS_X2_ENDSTOP(X,MIN) && !IS_Y2_ENDSTOP(X,MIN) && !IS_Z2_OR_PROBE(X,MIN))
750
-#define HAS_X_MAX (PIN_EXISTS(X_MAX) && !IS_X2_ENDSTOP(X,MAX) && !IS_Y2_ENDSTOP(X,MAX) && !IS_Z2_OR_PROBE(X,MAX))
751
-#define HAS_Y_MIN (PIN_EXISTS(Y_MIN) && !IS_X2_ENDSTOP(Y,MIN) && !IS_Y2_ENDSTOP(Y,MIN) && !IS_Z2_OR_PROBE(Y,MIN))
752
-#define HAS_Y_MAX (PIN_EXISTS(Y_MAX) && !IS_X2_ENDSTOP(Y,MAX) && !IS_Y2_ENDSTOP(Y,MAX) && !IS_Z2_OR_PROBE(Y,MAX))
753
-#define HAS_Z_MIN (PIN_EXISTS(Z_MIN) && !IS_X2_ENDSTOP(Z,MIN) && !IS_Y2_ENDSTOP(Z,MIN) && !IS_Z2_OR_PROBE(Z,MIN))
754
-#define HAS_Z_MAX (PIN_EXISTS(Z_MAX) && !IS_X2_ENDSTOP(Z,MAX) && !IS_Y2_ENDSTOP(Z,MAX) && !IS_Z2_OR_PROBE(Z,MAX))
761
+#define HAS_STOP_TEST(A,M) (PIN_EXISTS(A##_##M) && !IS_X2_ENDSTOP(A,M) && !IS_Y2_ENDSTOP(A,M) && !IS_Z2_OR_PROBE(A,M))
762
+#define HAS_X_MIN HAS_STOP_TEST(X,MIN)
763
+#define HAS_X_MAX HAS_STOP_TEST(X,MAX)
764
+#define HAS_Y_MIN HAS_STOP_TEST(Y,MIN)
765
+#define HAS_Y_MAX HAS_STOP_TEST(Y,MAX)
766
+#define HAS_Z_MIN HAS_STOP_TEST(Z,MIN)
767
+#define HAS_Z_MAX HAS_STOP_TEST(Z,MAX)
755 768
 #define HAS_X2_MIN (PIN_EXISTS(X2_MIN))
756 769
 #define HAS_X2_MAX (PIN_EXISTS(X2_MAX))
757 770
 #define HAS_Y2_MIN (PIN_EXISTS(Y2_MIN))
@@ -761,14 +774,18 @@
761 774
 #define HAS_Z_MIN_PROBE_PIN (PIN_EXISTS(Z_MIN_PROBE))
762 775
 
763 776
 // Thermistors
764
-#define HAS_TEMP_0 (PIN_EXISTS(TEMP_0) && TEMP_SENSOR_0 != 0 && TEMP_SENSOR_0 > -2)
765
-#define HAS_TEMP_1 (PIN_EXISTS(TEMP_1) && TEMP_SENSOR_1 != 0 && TEMP_SENSOR_1 > -2)
766
-#define HAS_TEMP_2 (PIN_EXISTS(TEMP_2) && TEMP_SENSOR_2 != 0 && TEMP_SENSOR_2 > -2)
767
-#define HAS_TEMP_3 (PIN_EXISTS(TEMP_3) && TEMP_SENSOR_3 != 0 && TEMP_SENSOR_3 > -2)
768
-#define HAS_TEMP_4 (PIN_EXISTS(TEMP_4) && TEMP_SENSOR_4 != 0 && TEMP_SENSOR_4 > -2)
769
-#define HAS_TEMP_HOTEND (HAS_TEMP_0 || ENABLED(HEATER_0_USES_MAX6675))
770
-#define HAS_TEMP_BED (PIN_EXISTS(TEMP_BED) && TEMP_SENSOR_BED != 0 && (TEMP_SENSOR_BED > -2 || TEMP_SENSOR_BED == -4))
771
-#define HAS_TEMP_CHAMBER (PIN_EXISTS(TEMP_CHAMBER) && TEMP_SENSOR_CHAMBER != 0 && TEMP_SENSOR_CHAMBER > -2)
777
+#define HAS_ADC_TEST(P) (PIN_EXISTS(TEMP_##P) && TEMP_SENSOR_##P != 0 && TEMP_SENSOR_##P > -2)
778
+#define HAS_TEMP_ADC_0 (HAS_ADC_TEST(0) && DISABLED(HEATER_0_USES_MAX6675))
779
+#define HAS_TEMP_ADC_1 HAS_ADC_TEST(1)
780
+#define HAS_TEMP_ADC_2 HAS_ADC_TEST(2)
781
+#define HAS_TEMP_ADC_3 HAS_ADC_TEST(3)
782
+#define HAS_TEMP_ADC_4 HAS_ADC_TEST(4)
783
+#define HAS_TEMP_ADC_BED HAS_ADC_TEST(BED)
784
+#define HAS_TEMP_ADC_CHAMBER HAS_ADC_TEST(CHAMBER)
785
+
786
+#define HAS_TEMP_HOTEND (HAS_TEMP_ADC_0 || ENABLED(HEATER_0_USES_MAX6675))
787
+#define HAS_TEMP_BED HAS_TEMP_ADC_BED
788
+#define HAS_TEMP_CHAMBER HAS_TEMP_ADC_CHAMBER
772 789
 
773 790
 // Heaters
774 791
 #define HAS_HEATER_0 (PIN_EXISTS(HEATER_0))

+ 31
- 31
Marlin/src/lcd/ultralcd.cpp 파일 보기

@@ -1579,7 +1579,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
1579 1579
    */
1580 1580
   void _lcd_preheat(const int16_t endnum, const int16_t temph, const int16_t tempb, const int16_t fan) {
1581 1581
     if (temph > 0) thermalManager.setTargetHotend(min(heater_maxtemp[endnum], temph), endnum);
1582
-    #if TEMP_SENSOR_BED != 0
1582
+    #if HAS_HEATED_BED
1583 1583
       if (tempb >= 0) thermalManager.setTargetBed(tempb);
1584 1584
     #else
1585 1585
       UNUSED(tempb);
@@ -1596,10 +1596,10 @@ void lcd_quick_feedback(const bool clear_buttons) {
1596 1596
     lcd_return_to_status();
1597 1597
   }
1598 1598
 
1599
-  #if TEMP_SENSOR_0 != 0
1599
+  #if HAS_TEMP_HOTEND
1600 1600
     void lcd_preheat_m1_e0_only() { _lcd_preheat(0, lcd_preheat_hotend_temp[0], -1, lcd_preheat_fan_speed[0]); }
1601 1601
     void lcd_preheat_m2_e0_only() { _lcd_preheat(0, lcd_preheat_hotend_temp[1], -1, lcd_preheat_fan_speed[1]); }
1602
-    #if TEMP_SENSOR_BED != 0
1602
+    #if HAS_HEATED_BED
1603 1603
       void lcd_preheat_m1_e0() { _lcd_preheat(0, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); }
1604 1604
       void lcd_preheat_m2_e0() { _lcd_preheat(0, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); }
1605 1605
     #endif
@@ -1608,28 +1608,28 @@ void lcd_quick_feedback(const bool clear_buttons) {
1608 1608
   #if HOTENDS > 1
1609 1609
     void lcd_preheat_m1_e1_only() { _lcd_preheat(1, lcd_preheat_hotend_temp[0], -1, lcd_preheat_fan_speed[0]); }
1610 1610
     void lcd_preheat_m2_e1_only() { _lcd_preheat(1, lcd_preheat_hotend_temp[1], -1, lcd_preheat_fan_speed[1]); }
1611
-    #if TEMP_SENSOR_BED != 0
1611
+    #if HAS_HEATED_BED
1612 1612
       void lcd_preheat_m1_e1() { _lcd_preheat(1, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); }
1613 1613
       void lcd_preheat_m2_e1() { _lcd_preheat(1, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); }
1614 1614
     #endif
1615 1615
     #if HOTENDS > 2
1616 1616
       void lcd_preheat_m1_e2_only() { _lcd_preheat(2, lcd_preheat_hotend_temp[0], -1, lcd_preheat_fan_speed[0]); }
1617 1617
       void lcd_preheat_m2_e2_only() { _lcd_preheat(2, lcd_preheat_hotend_temp[1], -1, lcd_preheat_fan_speed[1]); }
1618
-      #if TEMP_SENSOR_BED != 0
1618
+      #if HAS_HEATED_BED
1619 1619
         void lcd_preheat_m1_e2() { _lcd_preheat(2, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); }
1620 1620
         void lcd_preheat_m2_e2() { _lcd_preheat(2, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); }
1621 1621
       #endif
1622 1622
       #if HOTENDS > 3
1623 1623
         void lcd_preheat_m1_e3_only() { _lcd_preheat(3, lcd_preheat_hotend_temp[0], -1, lcd_preheat_fan_speed[0]); }
1624 1624
         void lcd_preheat_m2_e3_only() { _lcd_preheat(3, lcd_preheat_hotend_temp[1], -1, lcd_preheat_fan_speed[1]); }
1625
-        #if TEMP_SENSOR_BED != 0
1625
+        #if HAS_HEATED_BED
1626 1626
           void lcd_preheat_m1_e3() { _lcd_preheat(3, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); }
1627 1627
           void lcd_preheat_m2_e3() { _lcd_preheat(3, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); }
1628 1628
         #endif
1629 1629
         #if HOTENDS > 4
1630 1630
           void lcd_preheat_m1_e4_only() { _lcd_preheat(4, lcd_preheat_hotend_temp[0], -1, lcd_preheat_fan_speed[0]); }
1631 1631
           void lcd_preheat_m2_e4_only() { _lcd_preheat(4, lcd_preheat_hotend_temp[1], -1, lcd_preheat_fan_speed[1]); }
1632
-          #if TEMP_SENSOR_BED != 0
1632
+          #if HAS_HEATED_BED
1633 1633
             void lcd_preheat_m1_e4() { _lcd_preheat(4, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); }
1634 1634
             void lcd_preheat_m2_e4() { _lcd_preheat(4, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); }
1635 1635
           #endif
@@ -1650,7 +1650,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
1650 1650
           #endif // HOTENDS > 3
1651 1651
         #endif // HOTENDS > 2
1652 1652
       #endif // HOTENDS > 1
1653
-      #if TEMP_SENSOR_BED != 0
1653
+      #if HAS_HEATED_BED
1654 1654
         lcd_preheat_m1_e0();
1655 1655
       #else
1656 1656
         lcd_preheat_m1_e0_only();
@@ -1669,7 +1669,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
1669 1669
           #endif // HOTENDS > 3
1670 1670
         #endif // HOTENDS > 2
1671 1671
       #endif // HOTENDS > 1
1672
-      #if TEMP_SENSOR_BED != 0
1672
+      #if HAS_HEATED_BED
1673 1673
         lcd_preheat_m2_e0();
1674 1674
       #else
1675 1675
         lcd_preheat_m2_e0_only();
@@ -1678,25 +1678,25 @@ void lcd_quick_feedback(const bool clear_buttons) {
1678 1678
 
1679 1679
   #endif // HOTENDS > 1
1680 1680
 
1681
-  #if TEMP_SENSOR_BED != 0
1681
+  #if HAS_HEATED_BED
1682 1682
     void lcd_preheat_m1_bedonly() { _lcd_preheat(0, 0, lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); }
1683 1683
     void lcd_preheat_m2_bedonly() { _lcd_preheat(0, 0, lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); }
1684 1684
   #endif
1685 1685
 
1686
-  #if TEMP_SENSOR_0 != 0 && (TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_4 != 0 || TEMP_SENSOR_BED != 0)
1686
+  #if HAS_TEMP_HOTEND && (TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_4 != 0 || HAS_HEATED_BED)
1687 1687
 
1688 1688
     void lcd_preheat_m1_menu() {
1689 1689
       START_MENU();
1690 1690
       MENU_BACK(MSG_PREPARE);
1691 1691
       #if HOTENDS == 1
1692
-        #if TEMP_SENSOR_BED != 0
1692
+        #if HAS_HEATED_BED
1693 1693
           MENU_ITEM(function, MSG_PREHEAT_1, lcd_preheat_m1_e0);
1694 1694
           MENU_ITEM(function, MSG_PREHEAT_1_END, lcd_preheat_m1_e0_only);
1695 1695
         #else
1696 1696
           MENU_ITEM(function, MSG_PREHEAT_1, lcd_preheat_m1_e0_only);
1697 1697
         #endif
1698 1698
       #else
1699
-        #if TEMP_SENSOR_BED != 0
1699
+        #if HAS_HEATED_BED
1700 1700
           MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H1, lcd_preheat_m1_e0);
1701 1701
           MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E1, lcd_preheat_m1_e0_only);
1702 1702
           MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H2, lcd_preheat_m1_e1);
@@ -1706,21 +1706,21 @@ void lcd_quick_feedback(const bool clear_buttons) {
1706 1706
           MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H2, lcd_preheat_m1_e1_only);
1707 1707
         #endif
1708 1708
         #if HOTENDS > 2
1709
-          #if TEMP_SENSOR_BED != 0
1709
+          #if HAS_HEATED_BED
1710 1710
             MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H3, lcd_preheat_m1_e2);
1711 1711
             MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E3, lcd_preheat_m1_e2_only);
1712 1712
           #else
1713 1713
             MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H3, lcd_preheat_m1_e2_only);
1714 1714
           #endif
1715 1715
           #if HOTENDS > 3
1716
-            #if TEMP_SENSOR_BED != 0
1716
+            #if HAS_HEATED_BED
1717 1717
               MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H4, lcd_preheat_m1_e3);
1718 1718
               MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E4, lcd_preheat_m1_e3_only);
1719 1719
             #else
1720 1720
               MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H4, lcd_preheat_m1_e3_only);
1721 1721
             #endif
1722 1722
             #if HOTENDS > 4
1723
-              #if TEMP_SENSOR_BED != 0
1723
+              #if HAS_HEATED_BED
1724 1724
                 MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H5, lcd_preheat_m1_e4);
1725 1725
                 MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E5, lcd_preheat_m1_e4_only);
1726 1726
               #else
@@ -1731,7 +1731,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
1731 1731
         #endif // HOTENDS > 2
1732 1732
         MENU_ITEM(function, MSG_PREHEAT_1_ALL, lcd_preheat_m1_all);
1733 1733
       #endif // HOTENDS > 1
1734
-      #if TEMP_SENSOR_BED != 0
1734
+      #if HAS_HEATED_BED
1735 1735
         MENU_ITEM(function, MSG_PREHEAT_1_BEDONLY, lcd_preheat_m1_bedonly);
1736 1736
       #endif
1737 1737
       END_MENU();
@@ -1741,14 +1741,14 @@ void lcd_quick_feedback(const bool clear_buttons) {
1741 1741
       START_MENU();
1742 1742
       MENU_BACK(MSG_PREPARE);
1743 1743
       #if HOTENDS == 1
1744
-        #if TEMP_SENSOR_BED != 0
1744
+        #if HAS_HEATED_BED
1745 1745
           MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_m2_e0);
1746 1746
           MENU_ITEM(function, MSG_PREHEAT_2_END, lcd_preheat_m2_e0_only);
1747 1747
         #else
1748 1748
           MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_m2_e0_only);
1749 1749
         #endif
1750 1750
       #else
1751
-        #if TEMP_SENSOR_BED != 0
1751
+        #if HAS_HEATED_BED
1752 1752
           MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H1, lcd_preheat_m2_e0);
1753 1753
           MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E1, lcd_preheat_m2_e0_only);
1754 1754
           MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H2, lcd_preheat_m2_e1);
@@ -1758,21 +1758,21 @@ void lcd_quick_feedback(const bool clear_buttons) {
1758 1758
           MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H2, lcd_preheat_m2_e1_only);
1759 1759
         #endif
1760 1760
         #if HOTENDS > 2
1761
-          #if TEMP_SENSOR_BED != 0
1761
+          #if HAS_HEATED_BED
1762 1762
             MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H3, lcd_preheat_m2_e2);
1763 1763
             MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E3, lcd_preheat_m2_e2_only);
1764 1764
           #else
1765 1765
             MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H3, lcd_preheat_m2_e2_only);
1766 1766
           #endif
1767 1767
           #if HOTENDS > 3
1768
-            #if TEMP_SENSOR_BED != 0
1768
+            #if HAS_HEATED_BED
1769 1769
               MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H4, lcd_preheat_m2_e3);
1770 1770
               MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E4, lcd_preheat_m2_e3_only);
1771 1771
             #else
1772 1772
               MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H4, lcd_preheat_m2_e3_only);
1773 1773
             #endif
1774 1774
             #if HOTENDS > 4
1775
-              #if TEMP_SENSOR_BED != 0
1775
+              #if HAS_HEATED_BED
1776 1776
                 MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H5, lcd_preheat_m2_e4);
1777 1777
                 MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E5, lcd_preheat_m2_e4_only);
1778 1778
               #else
@@ -1783,13 +1783,13 @@ void lcd_quick_feedback(const bool clear_buttons) {
1783 1783
         #endif // HOTENDS > 2
1784 1784
         MENU_ITEM(function, MSG_PREHEAT_2_ALL, lcd_preheat_m2_all);
1785 1785
       #endif // HOTENDS > 1
1786
-      #if TEMP_SENSOR_BED != 0
1786
+      #if HAS_HEATED_BED
1787 1787
         MENU_ITEM(function, MSG_PREHEAT_2_BEDONLY, lcd_preheat_m2_bedonly);
1788 1788
       #endif
1789 1789
       END_MENU();
1790 1790
     }
1791 1791
 
1792
-  #endif // TEMP_SENSOR_0 && (TEMP_SENSOR_1 || TEMP_SENSOR_2 || TEMP_SENSOR_3 || TEMP_SENSOR_4 || TEMP_SENSOR_BED)
1792
+  #endif // HAS_TEMP_HOTEND && (TEMP_SENSOR_1 || TEMP_SENSOR_2 || TEMP_SENSOR_3 || TEMP_SENSOR_4 || TEMP_SENSOR_BED)
1793 1793
 
1794 1794
   void lcd_cooldown() {
1795 1795
     #if FAN_COUNT > 0
@@ -2780,7 +2780,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
2780 2780
       }
2781 2781
     #endif // ADVANCED_PAUSE_FEATURE
2782 2782
 
2783
-    #if TEMP_SENSOR_0 != 0
2783
+    #if HAS_TEMP_HOTEND
2784 2784
 
2785 2785
       //
2786 2786
       // Cooldown
@@ -2795,7 +2795,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
2795 2795
       //
2796 2796
       // Preheat for Material 1 and 2
2797 2797
       //
2798
-      #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_4 != 0 || TEMP_SENSOR_BED != 0
2798
+      #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_4 != 0 || HAS_HEATED_BED
2799 2799
         MENU_ITEM(submenu, MSG_PREHEAT_1, lcd_preheat_m1_menu);
2800 2800
         MENU_ITEM(submenu, MSG_PREHEAT_2, lcd_preheat_m2_menu);
2801 2801
       #else
@@ -2803,7 +2803,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
2803 2803
         MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_m2_e0_only);
2804 2804
       #endif
2805 2805
 
2806
-    #endif // TEMP_SENSOR_0 != 0
2806
+    #endif // HAS_TEMP_HOTEND
2807 2807
 
2808 2808
     //
2809 2809
     // BLTouch Self-Test and Reset
@@ -3538,7 +3538,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
3538 3538
     //
3539 3539
     // Autotemp, Min, Max, Fact
3540 3540
     //
3541
-    #if ENABLED(AUTOTEMP) && (TEMP_SENSOR_0 != 0)
3541
+    #if ENABLED(AUTOTEMP) && (HAS_TEMP_HOTEND)
3542 3542
       MENU_ITEM_EDIT(bool, MSG_AUTOTEMP, &planner.autotemp_enabled);
3543 3543
       MENU_ITEM_EDIT(float3, MSG_MIN, &planner.autotemp_min, 0, HEATER_0_MAXTEMP - 15);
3544 3544
       MENU_ITEM_EDIT(float3, MSG_MAX, &planner.autotemp_max, 0, HEATER_0_MAXTEMP - 15);
@@ -3633,10 +3633,10 @@ void lcd_quick_feedback(const bool clear_buttons) {
3633 3633
       START_MENU();
3634 3634
       MENU_BACK(MSG_TEMPERATURE);
3635 3635
       MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &lcd_preheat_fan_speed[material], 0, 255);
3636
-      #if TEMP_SENSOR_0 != 0
3636
+      #if HAS_TEMP_HOTEND
3637 3637
         MENU_ITEM_EDIT(int3, MSG_NOZZLE, &lcd_preheat_hotend_temp[material], MINTEMP_ALL, MAXTEMP_ALL - 15);
3638 3638
       #endif
3639
-      #if TEMP_SENSOR_BED != 0
3639
+      #if HAS_HEATED_BED
3640 3640
         MENU_ITEM_EDIT(int3, MSG_BED, &lcd_preheat_bed_temp[material], BED_MINTEMP, BED_MAXTEMP - 15);
3641 3641
       #endif
3642 3642
       #if ENABLED(EEPROM_SETTINGS)
@@ -4154,7 +4154,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
4154 4154
         STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_4_MAXTEMP), false);
4155 4155
       #endif
4156 4156
 
4157
-      #if TEMP_SENSOR_BED != 0
4157
+      #if HAS_HEATED_BED
4158 4158
         #undef THERMISTOR_ID
4159 4159
         #define THERMISTOR_ID TEMP_SENSOR_BED
4160 4160
         #include "thermistornames.h"

+ 75
- 85
Marlin/src/module/temperature.cpp 파일 보기

@@ -952,31 +952,31 @@ float Temperature::analog2temp(const int raw, const uint8_t e) {
952 952
     if (e == 0) return 0.25 * raw;
953 953
   #endif
954 954
 
955
+  // Thermistor with conversion table?
955 956
   if (heater_ttbl_map[e] != NULL) {
956
-    float celsius = 0;
957
-    uint8_t i;
958 957
     short(*tt)[][2] = (short(*)[][2])(heater_ttbl_map[e]);
959
-
960
-    for (i = 1; i < heater_ttbllen_map[e]; i++) {
961
-      if (PGM_RD_W((*tt)[i][0]) > raw) {
962
-        celsius = PGM_RD_W((*tt)[i - 1][1]) +
963
-                  (raw - PGM_RD_W((*tt)[i - 1][0])) *
964
-                  (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i - 1][1])) /
965
-                  (float)(PGM_RD_W((*tt)[i][0]) - PGM_RD_W((*tt)[i - 1][0]));
966
-        break;
958
+    for (uint8_t i = 1; i < heater_ttbllen_map[e]; i++) {
959
+      const short entry10 = PGM_RD_W((*tt)[i][0]);
960
+      if (entry10 > raw) {
961
+        const short entry00 = PGM_RD_W((*tt)[i - 1][0]),
962
+                    entry01 = PGM_RD_W((*tt)[i - 1][1]),
963
+                    entry11 = PGM_RD_W((*tt)[i][1]);
964
+        return entry01 + (raw - entry00) * float(entry11 - entry01) / float(entry10 - entry00);
967 965
       }
968 966
     }
969
-
970
-    // Overflow: Set to last value in the table
971
-    if (i == heater_ttbllen_map[e]) celsius = PGM_RD_W((*tt)[i - 1][1]);
972
-
973
-    return celsius;
967
+    return PGM_RD_W((*tt)[heater_ttbllen_map[e] - 1][1]); // Overflow: Return last value in the table
974 968
   }
975
-  #if defined(HEATER_USES_AD8495)
976
-  return ((raw * (660.0 / 1024.0) / OVERSAMPLENR) * (TEMP_SENSOR_AD8495_GAIN)) + TEMP_SENSOR_AD8495_OFFSET;
977
-  #else
978
-  return ((raw * ((5.0 * 100.0) / 1024.0) / OVERSAMPLENR) * (TEMP_SENSOR_AD595_GAIN)) + TEMP_SENSOR_AD595_OFFSET;
979
-  #endif  
969
+
970
+  // Thermocouple with amplifier ADC interface
971
+  return (raw *
972
+    #if HEATER_USES_AD8495
973
+      660.0 / 1024.0 / (OVERSAMPLENR) * (TEMP_SENSOR_AD8495_GAIN) + TEMP_SENSOR_AD8495_OFFSET
974
+    #elif HEATER_USES_AD595
975
+      5.0 * 100.0 / 1024.0 / (OVERSAMPLENR) * (TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET
976
+    #else
977
+      0
978
+    #endif
979
+  );
980 980
 }
981 981
 
982 982
 #if HAS_HEATED_BED
@@ -984,36 +984,31 @@ float Temperature::analog2temp(const int raw, const uint8_t e) {
984 984
   // For bed temperature measurement.
985 985
   float Temperature::analog2tempBed(const int raw) {
986 986
     #if ENABLED(BED_USES_THERMISTOR)
987
-      float celsius = 0;
988
-      byte i;
989
-
990
-      for (i = 1; i < BEDTEMPTABLE_LEN; i++) {
991
-        if (PGM_RD_W(BEDTEMPTABLE[i][0]) > raw) {
992
-          celsius  = PGM_RD_W(BEDTEMPTABLE[i - 1][1]) +
993
-                     (raw - PGM_RD_W(BEDTEMPTABLE[i - 1][0])) *
994
-                     (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i - 1][1])) /
995
-                     (float)(PGM_RD_W(BEDTEMPTABLE[i][0]) - PGM_RD_W(BEDTEMPTABLE[i - 1][0]));
996
-          break;
987
+
988
+      // Thermistor with conversion table
989
+      for (uint8_t i = 1; i < BEDTEMPTABLE_LEN; i++) {
990
+        const short entry10 = PGM_RD_W(BEDTEMPTABLE[i][0]);
991
+        if (entry10 > raw) {
992
+          const short entry00 = PGM_RD_W(BEDTEMPTABLE[i - 1][0]),
993
+                      entry01 = PGM_RD_W(BEDTEMPTABLE[i - 1][1]),
994
+                      entry11 = PGM_RD_W(BEDTEMPTABLE[i][1]);
995
+          return entry01 + (raw - entry00) * float(entry11 - entry01) / float(entry10 - entry00);
997 996
         }
998 997
       }
999
-
1000
-      // Overflow: Set to last value in the table
1001
-      if (i == BEDTEMPTABLE_LEN) celsius = PGM_RD_W(BEDTEMPTABLE[i - 1][1]);
1002
-
1003
-      return celsius;
1004
-
1005
-    #elif defined(BED_USES_AD595)
1006
-
1007
-      return ((raw * ((5.0 * 100.0) / 1024.0) / OVERSAMPLENR) * (TEMP_SENSOR_AD595_GAIN)) + TEMP_SENSOR_AD595_OFFSET;
1008
-
1009
-	#elif defined(BED_USES_AD8495)
1010
-
1011
-      return ((raw * (660.0 / 1024.0) / OVERSAMPLENR) * (TEMP_SENSOR_AD8495_GAIN)) + TEMP_SENSOR_AD8495_OFFSET;
998
+      return PGM_RD_W(BEDTEMPTABLE[BEDTEMPTABLE_LEN - 1][1]); // Overflow: Return last value in the table
1012 999
 
1013 1000
     #else
1014 1001
 
1015
-      UNUSED(raw);
1016
-      return 0;
1002
+      // Thermocouple with amplifier ADC interface
1003
+      return (raw *
1004
+        #if ENABLED(BED_USES_AD595)
1005
+          5.0 * 100.0 / 1024.0 / (OVERSAMPLENR) * (TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET
1006
+        #elif ENABLED(BED_USES_AD8495)
1007
+          660.0 / 1024.0 / (OVERSAMPLENR) * (TEMP_SENSOR_AD8495_GAIN) + TEMP_SENSOR_AD8495_OFFSET
1008
+        #else
1009
+          0
1010
+        #endif
1011
+      );
1017 1012
 
1018 1013
     #endif
1019 1014
   }
@@ -1024,36 +1019,31 @@ float Temperature::analog2temp(const int raw, const uint8_t e) {
1024 1019
   // For chamber temperature measurement.
1025 1020
   float Temperature::analog2tempChamber(const int raw) {
1026 1021
     #if ENABLED(CHAMBER_USES_THERMISTOR)
1027
-      float celsius = 0;
1028
-      byte i;
1029
-
1030
-      for (i = 1; i < CHAMBERTEMPTABLE_LEN; i++) {
1031
-        if (PGM_RD_W(CHAMBERTEMPTABLE[i][0]) > raw) {
1032
-          celsius  = PGM_RD_W(CHAMBERTEMPTABLE[i - 1][1]) +
1033
-                     (raw - PGM_RD_W(CHAMBERTEMPTABLE[i - 1][0])) *
1034
-                     (float)(PGM_RD_W(CHAMBERTEMPTABLE[i][1]) - PGM_RD_W(CHAMBERTEMPTABLE[i - 1][1])) /
1035
-                     (float)(PGM_RD_W(CHAMBERTEMPTABLE[i][0]) - PGM_RD_W(CHAMBERTEMPTABLE[i - 1][0]));
1036
-          break;
1022
+
1023
+      // Thermistor with conversion table
1024
+      for (uint8_t i = 1; i < CHAMBERTEMPTABLE_LEN; i++) {
1025
+        const short entry10 = PGM_RD_W(CHAMBERTEMPTABLE[i][0]);
1026
+        if (entry10 > raw) {
1027
+          const short entry00 = PGM_RD_W(CHAMBERTEMPTABLE[i - 1][0]),
1028
+                      entry01 = PGM_RD_W(CHAMBERTEMPTABLE[i - 1][1]),
1029
+                      entry11 = PGM_RD_W(CHAMBERTEMPTABLE[i][1]);
1030
+          return entry01 + (raw - entry00) * float(entry11 - entry01) / float(entry10 - entry00);
1037 1031
         }
1038 1032
       }
1033
+      return PGM_RD_W(CHAMBERTEMPTABLE[CHAMBERTEMPTABLE_LEN - 1][1]); // Overflow: Return last value in the table
1039 1034
 
1040
-      // Overflow: Set to last value in the table
1041
-      if (i == CHAMBERTEMPTABLE_LEN) celsius = PGM_RD_W(CHAMBERTEMPTABLE[i - 1][1]);
1042
-
1043
-      return celsius;
1044
-
1045
-    #elif defined(CHAMBER_USES_AD595)
1046
-
1047
-      return ((raw * ((5.0 * 100.0) / 1024.0) / OVERSAMPLENR) * (TEMP_SENSOR_AD595_GAIN)) + TEMP_SENSOR_AD595_OFFSET;
1048
-
1049
-    #elif defined(CHAMBER_USES_AD8495)
1050
-
1051
-      return ((raw * (660.0 / 1024.0) / OVERSAMPLENR) * (TEMP_SENSOR_AD8495_GAIN)) + TEMP_SENSOR_AD8495_OFFSET;
1052
-	  
1053 1035
     #else
1054 1036
 
1055
-      UNUSED(raw);
1056
-      return 0;
1037
+      // Thermocouple with amplifier ADC interface
1038
+      return (raw *
1039
+        #if ENABLED(CHAMBER_USES_AD595)
1040
+          5.0 * 100.0 / 1024.0 / (OVERSAMPLENR) * (TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET
1041
+        #elif ENABLED(CHAMBER_USES_AD8495)
1042
+          660.0 / 1024.0 / (OVERSAMPLENR) * (TEMP_SENSOR_AD8495_GAIN) + TEMP_SENSOR_AD8495_OFFSET
1043
+        #else
1044
+          0
1045
+        #endif
1046
+      );
1057 1047
 
1058 1048
     #endif
1059 1049
   }
@@ -1208,19 +1198,19 @@ void Temperature::init() {
1208 1198
 
1209 1199
   HAL_adc_init();
1210 1200
 
1211
-  #if HAS_TEMP_0
1201
+  #if HAS_TEMP_ADC_0
1212 1202
     HAL_ANALOG_SELECT(TEMP_0_PIN);
1213 1203
   #endif
1214
-  #if HAS_TEMP_1
1204
+  #if HAS_TEMP_ADC_1
1215 1205
     HAL_ANALOG_SELECT(TEMP_1_PIN);
1216 1206
   #endif
1217
-  #if HAS_TEMP_2
1207
+  #if HAS_TEMP_ADC_2
1218 1208
     HAL_ANALOG_SELECT(TEMP_2_PIN);
1219 1209
   #endif
1220
-  #if HAS_TEMP_3
1210
+  #if HAS_TEMP_ADC_3
1221 1211
     HAL_ANALOG_SELECT(TEMP_3_PIN);
1222 1212
   #endif
1223
-  #if HAS_TEMP_4
1213
+  #if HAS_TEMP_ADC_4
1224 1214
     HAL_ANALOG_SELECT(TEMP_4_PIN);
1225 1215
   #endif
1226 1216
   #if HAS_HEATED_BED
@@ -1687,20 +1677,20 @@ void Temperature::disable_all_heaters() {
1687 1677
  * Get raw temperatures
1688 1678
  */
1689 1679
 void Temperature::set_current_temp_raw() {
1690
-  #if HAS_TEMP_0 && DISABLED(HEATER_0_USES_MAX6675)
1680
+  #if HAS_TEMP_ADC_0 && DISABLED(HEATER_0_USES_MAX6675)
1691 1681
     current_temperature_raw[0] = raw_temp_value[0];
1692 1682
   #endif
1693
-  #if HAS_TEMP_1
1683
+  #if HAS_TEMP_ADC_1
1694 1684
     #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
1695 1685
       redundant_temperature_raw = raw_temp_value[1];
1696 1686
     #else
1697 1687
       current_temperature_raw[1] = raw_temp_value[1];
1698 1688
     #endif
1699
-    #if HAS_TEMP_2
1689
+    #if HAS_TEMP_ADC_2
1700 1690
       current_temperature_raw[2] = raw_temp_value[2];
1701
-      #if HAS_TEMP_3
1691
+      #if HAS_TEMP_ADC_3
1702 1692
         current_temperature_raw[3] = raw_temp_value[3];
1703
-        #if HAS_TEMP_4
1693
+        #if HAS_TEMP_ADC_4
1704 1694
           current_temperature_raw[4] = raw_temp_value[4];
1705 1695
         #endif
1706 1696
       #endif
@@ -2050,7 +2040,7 @@ void Temperature::isr() {
2050 2040
         adc_sensor_state = (ADCSensorState)0; // Fall-through to start first sensor now
2051 2041
     }
2052 2042
 
2053
-    #if HAS_TEMP_0
2043
+    #if HAS_TEMP_ADC_0
2054 2044
       case PrepareTemp_0:
2055 2045
         HAL_START_ADC(TEMP_0_PIN);
2056 2046
         break;
@@ -2077,7 +2067,7 @@ void Temperature::isr() {
2077 2067
         break;
2078 2068
     #endif
2079 2069
 
2080
-    #if HAS_TEMP_1
2070
+    #if HAS_TEMP_ADC_1
2081 2071
       case PrepareTemp_1:
2082 2072
         HAL_START_ADC(TEMP_1_PIN);
2083 2073
         break;
@@ -2086,7 +2076,7 @@ void Temperature::isr() {
2086 2076
         break;
2087 2077
     #endif
2088 2078
 
2089
-    #if HAS_TEMP_2
2079
+    #if HAS_TEMP_ADC_2
2090 2080
       case PrepareTemp_2:
2091 2081
         HAL_START_ADC(TEMP_2_PIN);
2092 2082
         break;
@@ -2095,7 +2085,7 @@ void Temperature::isr() {
2095 2085
         break;
2096 2086
     #endif
2097 2087
 
2098
-    #if HAS_TEMP_3
2088
+    #if HAS_TEMP_ADC_3
2099 2089
       case PrepareTemp_3:
2100 2090
         HAL_START_ADC(TEMP_3_PIN);
2101 2091
         break;
@@ -2104,7 +2094,7 @@ void Temperature::isr() {
2104 2094
         break;
2105 2095
     #endif
2106 2096
 
2107
-    #if HAS_TEMP_4
2097
+    #if HAS_TEMP_ADC_4
2108 2098
       case PrepareTemp_4:
2109 2099
         HAL_START_ADC(TEMP_4_PIN);
2110 2100
         break;

+ 5
- 5
Marlin/src/module/temperature.h 파일 보기

@@ -50,23 +50,23 @@
50 50
  * States for ADC reading in the ISR
51 51
  */
52 52
 enum ADCSensorState : char {
53
-  #if HAS_TEMP_0
53
+  #if HAS_TEMP_ADC_0
54 54
     PrepareTemp_0,
55 55
     MeasureTemp_0,
56 56
   #endif
57
-  #if HAS_TEMP_1
57
+  #if HAS_TEMP_ADC_1
58 58
     PrepareTemp_1,
59 59
     MeasureTemp_1,
60 60
   #endif
61
-  #if HAS_TEMP_2
61
+  #if HAS_TEMP_ADC_2
62 62
     PrepareTemp_2,
63 63
     MeasureTemp_2,
64 64
   #endif
65
-  #if HAS_TEMP_3
65
+  #if HAS_TEMP_ADC_3
66 66
     PrepareTemp_3,
67 67
     MeasureTemp_3,
68 68
   #endif
69
-  #if HAS_TEMP_4
69
+  #if HAS_TEMP_ADC_4
70 70
     PrepareTemp_4,
71 71
     MeasureTemp_4,
72 72
   #endif

Loading…
취소
저장