Bläddra i källkod

[2.0.x] Enable AD595 and AD8495 in concert (#10693)

* Allow both AD595 and AD8495 in concert
* General temperature code tweaks
Scott Lahteine 6 år sedan
förälder
incheckning
325bbbc8c2
Inget konto är kopplat till bidragsgivarens mejladress

+ 22
- 26
Marlin/src/inc/Conditionals_post.h Visa fil

@@ -329,9 +329,9 @@
329 329
 #if TEMP_SENSOR_1 == -4
330 330
   #define HEATER_1_USES_AD8495
331 331
 #elif TEMP_SENSOR_1 == -3
332
-  #error "MAX31855 Thermocouples not supported for TEMP_SENSOR_1"
332
+  #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_1."
333 333
 #elif TEMP_SENSOR_1 == -2
334
-  #error "MAX6675 Thermocouples not supported for TEMP_SENSOR_1"
334
+  #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_1."
335 335
 #elif TEMP_SENSOR_1 == -1
336 336
   #define HEATER_1_USES_AD595
337 337
 #elif TEMP_SENSOR_1 == 0
@@ -345,9 +345,9 @@
345 345
 #if TEMP_SENSOR_2 == -4
346 346
   #define HEATER_2_USES_AD8495
347 347
 #elif TEMP_SENSOR_2 == -3
348
-  #error "MAX31855 Thermocouples not supported for TEMP_SENSOR_2"
348
+  #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_2."
349 349
 #elif TEMP_SENSOR_2 == -2
350
-  #error "MAX6675 Thermocouples not supported for TEMP_SENSOR_2"
350
+  #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_2."
351 351
 #elif TEMP_SENSOR_2 == -1
352 352
   #define HEATER_2_USES_AD595
353 353
 #elif TEMP_SENSOR_2 == 0
@@ -361,9 +361,9 @@
361 361
 #if TEMP_SENSOR_3 == -4
362 362
   #define HEATER_3_USES_AD8495
363 363
 #elif TEMP_SENSOR_3 == -3
364
-  #error "MAX31855 Thermocouples not supported for TEMP_SENSOR_3"
364
+  #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_3."
365 365
 #elif TEMP_SENSOR_3 == -2
366
-  #error "MAX6675 Thermocouples not supported for TEMP_SENSOR_3"
366
+  #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_3."
367 367
 #elif TEMP_SENSOR_3 == -1
368 368
   #define HEATER_3_USES_AD595
369 369
 #elif TEMP_SENSOR_3 == 0
@@ -377,9 +377,9 @@
377 377
 #if TEMP_SENSOR_4 == -4
378 378
   #define HEATER_4_USES_AD8495
379 379
 #elif TEMP_SENSOR_4 == -3
380
-  #error "MAX31855 Thermocouples not supported for TEMP_SENSOR_4"
380
+  #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_4."
381 381
 #elif TEMP_SENSOR_4 == -2
382
-  #error "MAX6675 Thermocouples not supported for TEMP_SENSOR_4"
382
+  #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_4."
383 383
 #elif TEMP_SENSOR_4 == -1
384 384
   #define HEATER_4_USES_AD595
385 385
 #elif TEMP_SENSOR_4 == 0
@@ -391,39 +391,35 @@
391 391
 #endif
392 392
 
393 393
 #if TEMP_SENSOR_BED == -4
394
-  #define BED_USES_AD8495
394
+  #define HEATER_BED_USES_AD8495
395 395
 #elif TEMP_SENSOR_BED == -3
396
-  #error "MAX31855 Thermocouples not supported for TEMP_SENSOR_BED"
396
+  #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_BED."
397 397
 #elif TEMP_SENSOR_BED == -2
398
-  #error "MAX6675 Thermocouples not supported for TEMP_SENSOR_BED"
398
+  #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_BED."
399 399
 #elif TEMP_SENSOR_BED == -1
400
-  #define BED_USES_AD595
400
+  #define HEATER_BED_USES_AD595
401 401
 #elif TEMP_SENSOR_BED == 0
402 402
   #undef BED_MINTEMP
403 403
   #undef BED_MAXTEMP
404 404
 #elif TEMP_SENSOR_BED > 0
405 405
   #define THERMISTORBED TEMP_SENSOR_BED
406
-  #define BED_USES_THERMISTOR
406
+  #define HEATER_BED_USES_THERMISTOR
407 407
 #endif
408 408
 
409 409
 #if TEMP_SENSOR_CHAMBER == -4
410
-  #define CHAMBER_USES_AD8495
410
+  #define HEATER_CHAMBER_USES_AD8495
411 411
 #elif TEMP_SENSOR_CHAMBER == -3
412
-  #error "MAX31855 Thermocouples not supported for TEMP_SENSOR_CHAMBER"
412
+  #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_CHAMBER."
413 413
 #elif TEMP_SENSOR_CHAMBER == -2
414
-  #error "MAX6675 Thermocouples not supported for TEMP_SENSOR_CHAMBER"
414
+  #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_CHAMBER."
415 415
 #elif TEMP_SENSOR_CHAMBER == -1
416
-  #define CHAMBER_USES_AD595
416
+  #define HEATER_CHAMBER_USES_AD595
417 417
 #elif TEMP_SENSOR_CHAMBER > 0
418 418
   #define THERMISTORCHAMBER TEMP_SENSOR_CHAMBER
419
-  #define CHAMBER_USES_THERMISTOR
419
+  #define HEATER_CHAMBER_USES_THERMISTOR
420 420
 #endif
421 421
 
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))
423
-
424
-#ifdef __SAM3X8E__
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))
426
-#endif
422
+#define HOTEND_USES_THERMISTOR (ENABLED(HEATER_0_USES_THERMISTOR) || ENABLED(HEATER_1_USES_THERMISTOR) || ENABLED(HEATER_2_USES_THERMISTOR) || ENABLED(HEATER_3_USES_THERMISTOR) || ENABLED(HEATER_4_USES_THERMISTOR))
427 423
 
428 424
 /**
429 425
  * Default hotend offsets, if not defined
@@ -773,9 +769,9 @@
773 769
 #define HAS_Z2_MAX (PIN_EXISTS(Z2_MAX))
774 770
 #define HAS_Z_MIN_PROBE_PIN (PIN_EXISTS(Z_MIN_PROBE))
775 771
 
776
-// Thermistors
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))
772
+// ADC Temp Sensors (Thermistor or Thermocouple with amplifier ADC interface)
773
+#define HAS_ADC_TEST(P) (PIN_EXISTS(TEMP_##P) && TEMP_SENSOR_##P != 0 && DISABLED(HEATER_##P##_USES_MAX6675))
774
+#define HAS_TEMP_ADC_0 HAS_ADC_TEST(0)
779 775
 #define HAS_TEMP_ADC_1 HAS_ADC_TEST(1)
780 776
 #define HAS_TEMP_ADC_2 HAS_ADC_TEST(2)
781 777
 #define HAS_TEMP_ADC_3 HAS_ADC_TEST(3)

+ 1
- 1
Marlin/src/lcd/ultralcd.cpp Visa fil

@@ -3539,7 +3539,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
3539 3539
     //
3540 3540
     // Autotemp, Min, Max, Fact
3541 3541
     //
3542
-    #if ENABLED(AUTOTEMP) && (HAS_TEMP_HOTEND)
3542
+    #if ENABLED(AUTOTEMP) && HAS_TEMP_HOTEND
3543 3543
       MENU_ITEM_EDIT(bool, MSG_AUTOTEMP, &planner.autotemp_enabled);
3544 3544
       MENU_ITEM_EDIT(float3, MSG_MIN, &planner.autotemp_min, 0, HEATER_0_MAXTEMP - 15);
3545 3545
       MENU_ITEM_EDIT(float3, MSG_MAX, &planner.autotemp_max, 0, HEATER_0_MAXTEMP - 15);

+ 77
- 88
Marlin/src/module/temperature.cpp Visa fil

@@ -53,12 +53,14 @@
53 53
   #include "../feature/emergency_parser.h"
54 54
 #endif
55 55
 
56
-#if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
57
-  static void* heater_ttbl_map[2] = { (void*)HEATER_0_TEMPTABLE, (void*)HEATER_1_TEMPTABLE };
58
-  static uint8_t heater_ttbllen_map[2] = { HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN };
59
-#else
60
-  static void* heater_ttbl_map[HOTENDS] = ARRAY_BY_HOTENDS((void*)HEATER_0_TEMPTABLE, (void*)HEATER_1_TEMPTABLE, (void*)HEATER_2_TEMPTABLE, (void*)HEATER_3_TEMPTABLE, (void*)HEATER_4_TEMPTABLE);
61
-  static uint8_t heater_ttbllen_map[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN, HEATER_2_TEMPTABLE_LEN, HEATER_3_TEMPTABLE_LEN, HEATER_4_TEMPTABLE_LEN);
56
+#if HOTEND_USES_THERMISTOR
57
+  #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
58
+    static void* heater_ttbl_map[2] = { (void*)HEATER_0_TEMPTABLE, (void*)HEATER_1_TEMPTABLE };
59
+    static uint8_t heater_ttbllen_map[2] = { HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN };
60
+  #else
61
+    static void* heater_ttbl_map[HOTENDS] = ARRAY_BY_HOTENDS((void*)HEATER_0_TEMPTABLE, (void*)HEATER_1_TEMPTABLE, (void*)HEATER_2_TEMPTABLE, (void*)HEATER_3_TEMPTABLE, (void*)HEATER_4_TEMPTABLE);
62
+    static uint8_t heater_ttbllen_map[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN, HEATER_2_TEMPTABLE_LEN, HEATER_3_TEMPTABLE_LEN, HEATER_4_TEMPTABLE_LEN);
63
+  #endif
62 64
 #endif
63 65
 
64 66
 Temperature thermalManager;
@@ -930,7 +932,21 @@ void Temperature::manage_heater() {
930 932
   #endif // HAS_HEATED_BED
931 933
 }
932 934
 
933
-#define PGM_RD_W(x)   (short)pgm_read_word(&x)
935
+#define TEMP_AD595(RAW)  ((RAW) * 5.0 * 100.0 / 1024.0 / (OVERSAMPLENR) * (TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET)
936
+#define TEMP_AD8495(RAW) ((RAW) * 6.6 * 100.0 / 1024.0 / (OVERSAMPLENR) * (TEMP_SENSOR_AD8495_GAIN) + TEMP_SENSOR_AD8495_OFFSET)
937
+
938
+#define SCAN_THERMISTOR_TABLE(TBL,LEN) do{                          \
939
+  for (uint8_t i = 1; i < LEN; i++) {                               \
940
+    const short entry10 = (short)pgm_read_word(&TBL[i][0]);         \
941
+    if (entry10 > raw) {                                            \
942
+      const short entry00 = (short)pgm_read_word(&TBL[i-1][0]),     \
943
+                  entry01 = (short)pgm_read_word(&TBL[i-1][1]),     \
944
+                  entry11 = (short)pgm_read_word(&TBL[i][1]);       \
945
+      return entry01 + (raw - entry00) * float(entry11 - entry01) / float(entry10 - entry00); \
946
+    }                                                               \
947
+  }                                                                 \
948
+  return (short)pgm_read_word(&TBL[LEN-1][1]);                      \
949
+}while(0)
934 950
 
935 951
 // Derived from RepRap FiveD extruder::getTemperature()
936 952
 // For hot end temperature measurement.
@@ -948,68 +964,61 @@ float Temperature::analog2temp(const int raw, const uint8_t e) {
948 964
       return 0.0;
949 965
     }
950 966
 
951
-  #if ENABLED(HEATER_0_USES_MAX6675)
952
-    if (e == 0) return 0.25 * raw;
953
-  #endif
954
-
955
-  // Thermistor with conversion table?
956
-  if (heater_ttbl_map[e] != NULL) {
957
-    short(*tt)[][2] = (short(*)[][2])(heater_ttbl_map[e]);
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);
965
-      }
966
-    }
967
-    return PGM_RD_W((*tt)[heater_ttbllen_map[e] - 1][1]); // Overflow: Return last value in the table
967
+  switch (e) {
968
+    case 0:
969
+      #if ENABLED(HEATER_0_USES_MAX6675)
970
+        return raw * 0.25;
971
+      #elif ENABLED(HEATER_0_USES_AD595)
972
+        return TEMP_AD595(raw);
973
+      #elif ENABLED(HEATER_0_USES_AD8495)
974
+        return TEMP_AD8495(raw);
975
+      #endif
976
+    case 1:
977
+      #if ENABLED(HEATER_1_USES_AD595)
978
+        return TEMP_AD595(raw);
979
+      #elif ENABLED(HEATER_1_USES_AD8495)
980
+        return TEMP_AD8495(raw);
981
+      #endif
982
+    case 2:
983
+      #if ENABLED(HEATER_2_USES_AD595)
984
+        return TEMP_AD595(raw);
985
+      #elif ENABLED(HEATER_2_USES_AD8495)
986
+        return TEMP_AD8495(raw);
987
+      #endif
988
+    case 3:
989
+      #if ENABLED(HEATER_3_USES_AD595)
990
+        return TEMP_AD595(raw);
991
+      #elif ENABLED(HEATER_3_USES_AD8495)
992
+        return TEMP_AD8495(raw);
993
+      #endif
994
+    case 4:
995
+      #if ENABLED(HEATER_4_USES_AD595)
996
+        return TEMP_AD595(raw);
997
+      #elif ENABLED(HEATER_4_USES_AD8495)
998
+        return TEMP_AD8495(raw);
999
+      #endif
1000
+    default: break;
968 1001
   }
969 1002
 
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
-  );
1003
+  #if HOTEND_USES_THERMISTOR
1004
+    // Thermistor with conversion table?
1005
+    const short(*tt)[][2] = (short(*)[][2])(heater_ttbl_map[e]);
1006
+    SCAN_THERMISTOR_TABLE((*tt), heater_ttbllen_map[e]);
1007
+  #endif
980 1008
 }
981 1009
 
982 1010
 #if HAS_HEATED_BED
983 1011
   // Derived from RepRap FiveD extruder::getTemperature()
984 1012
   // For bed temperature measurement.
985 1013
   float Temperature::analog2tempBed(const int raw) {
986
-    #if ENABLED(BED_USES_THERMISTOR)
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);
996
-        }
997
-      }
998
-      return PGM_RD_W(BEDTEMPTABLE[BEDTEMPTABLE_LEN - 1][1]); // Overflow: Return last value in the table
999
-
1014
+    #if ENABLED(HEATER_BED_USES_THERMISTOR)
1015
+      SCAN_THERMISTOR_TABLE(BEDTEMPTABLE, BEDTEMPTABLE_LEN);
1016
+    #elif ENABLED(HEATER_BED_USES_AD595)
1017
+      return TEMP_AD595(raw);
1018
+    #elif ENABLED(HEATER_BED_USES_AD8495)
1019
+      return TEMP_AD8495(raw);
1000 1020
     #else
1001
-
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
-      );
1012
-
1021
+      return 0;
1013 1022
     #endif
1014 1023
   }
1015 1024
 #endif // HAS_HEATED_BED
@@ -1018,33 +1027,14 @@ float Temperature::analog2temp(const int raw, const uint8_t e) {
1018 1027
   // Derived from RepRap FiveD extruder::getTemperature()
1019 1028
   // For chamber temperature measurement.
1020 1029
   float Temperature::analog2tempChamber(const int raw) {
1021
-    #if ENABLED(CHAMBER_USES_THERMISTOR)
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);
1031
-        }
1032
-      }
1033
-      return PGM_RD_W(CHAMBERTEMPTABLE[CHAMBERTEMPTABLE_LEN - 1][1]); // Overflow: Return last value in the table
1034
-
1030
+    #if ENABLED(HEATER_CHAMBER_USES_THERMISTOR)
1031
+      SCAN_THERMISTOR_TABLE(CHAMBERTEMPTABLE, CHAMBERTEMPTABLE_LEN);
1032
+    #elif ENABLED(HEATER_CHAMBER_USES_AD595)
1033
+      return TEMP_AD595(raw);
1034
+    #elif ENABLED(HEATER_CHAMBER_USES_AD8495)
1035
+      return TEMP_AD8495(raw);
1035 1036
     #else
1036
-
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
-      );
1047
-
1037
+      return 0;
1048 1038
     #endif
1049 1039
   }
1050 1040
 #endif // HAS_TEMP_CHAMBER
@@ -1059,8 +1049,7 @@ void Temperature::updateTemperaturesFromRawValues() {
1059 1049
   #if ENABLED(HEATER_0_USES_MAX6675)
1060 1050
     current_temperature_raw[0] = read_max6675();
1061 1051
   #endif
1062
-  HOTEND_LOOP()
1063
-    current_temperature[e] = Temperature::analog2temp(current_temperature_raw[e], e);
1052
+  HOTEND_LOOP() current_temperature[e] = Temperature::analog2temp(current_temperature_raw[e], e);
1064 1053
   #if HAS_HEATED_BED
1065 1054
     current_temperature_bed = Temperature::analog2tempBed(current_temperature_bed_raw);
1066 1055
   #endif

+ 9
- 9
Marlin/src/module/thermistor/thermistors.h Visa fil

@@ -131,7 +131,7 @@
131 131
 #define _TT_NAME(_N) temptable_ ## _N
132 132
 #define TT_NAME(_N) _TT_NAME(_N)
133 133
 
134
-#ifdef THERMISTORHEATER_0
134
+#if THERMISTORHEATER_0
135 135
   #define HEATER_0_TEMPTABLE TT_NAME(THERMISTORHEATER_0)
136 136
   #define HEATER_0_TEMPTABLE_LEN COUNT(HEATER_0_TEMPTABLE)
137 137
 #elif defined(HEATER_0_USES_THERMISTOR)
@@ -141,7 +141,7 @@
141 141
   #define HEATER_0_TEMPTABLE_LEN 0
142 142
 #endif
143 143
 
144
-#ifdef THERMISTORHEATER_1
144
+#if THERMISTORHEATER_1
145 145
   #define HEATER_1_TEMPTABLE TT_NAME(THERMISTORHEATER_1)
146 146
   #define HEATER_1_TEMPTABLE_LEN COUNT(HEATER_1_TEMPTABLE)
147 147
 #elif defined(HEATER_1_USES_THERMISTOR)
@@ -151,7 +151,7 @@
151 151
   #define HEATER_1_TEMPTABLE_LEN 0
152 152
 #endif
153 153
 
154
-#ifdef THERMISTORHEATER_2
154
+#if THERMISTORHEATER_2
155 155
   #define HEATER_2_TEMPTABLE TT_NAME(THERMISTORHEATER_2)
156 156
   #define HEATER_2_TEMPTABLE_LEN COUNT(HEATER_2_TEMPTABLE)
157 157
 #elif defined(HEATER_2_USES_THERMISTOR)
@@ -161,7 +161,7 @@
161 161
   #define HEATER_2_TEMPTABLE_LEN 0
162 162
 #endif
163 163
 
164
-#ifdef THERMISTORHEATER_3
164
+#if THERMISTORHEATER_3
165 165
   #define HEATER_3_TEMPTABLE TT_NAME(THERMISTORHEATER_3)
166 166
   #define HEATER_3_TEMPTABLE_LEN COUNT(HEATER_3_TEMPTABLE)
167 167
 #elif defined(HEATER_3_USES_THERMISTOR)
@@ -171,7 +171,7 @@
171 171
   #define HEATER_3_TEMPTABLE_LEN 0
172 172
 #endif
173 173
 
174
-#ifdef THERMISTORHEATER_4
174
+#if THERMISTORHEATER_4
175 175
   #define HEATER_4_TEMPTABLE TT_NAME(THERMISTORHEATER_4)
176 176
   #define HEATER_4_TEMPTABLE_LEN COUNT(HEATER_4_TEMPTABLE)
177 177
 #elif defined(HEATER_4_USES_THERMISTOR)
@@ -185,7 +185,7 @@
185 185
   #define BEDTEMPTABLE TT_NAME(THERMISTORBED)
186 186
   #define BEDTEMPTABLE_LEN COUNT(BEDTEMPTABLE)
187 187
 #else
188
-  #ifdef BED_USES_THERMISTOR
188
+  #ifdef HEATER_BED_USES_THERMISTOR
189 189
     #error "No bed thermistor table specified"
190 190
   #endif
191 191
 #endif
@@ -194,7 +194,7 @@
194 194
   #define CHAMBERTEMPTABLE TT_NAME(THERMISTORCHAMBER)
195 195
   #define CHAMBERTEMPTABLE_LEN COUNT(CHAMBERTEMPTABLE)
196 196
 #else
197
-  #ifdef CHAMBER_USES_THERMISTOR
197
+  #ifdef HEATER_CHAMBER_USES_THERMISTOR
198 198
     #error "No chamber thermistor table specified"
199 199
   #endif
200 200
 #endif
@@ -248,7 +248,7 @@
248 248
   #endif
249 249
 #endif
250 250
 #ifndef HEATER_BED_RAW_HI_TEMP
251
-  #ifdef BED_USES_THERMISTOR
251
+  #ifdef HEATER_BED_USES_THERMISTOR
252 252
     #define HEATER_BED_RAW_HI_TEMP 0
253 253
     #define HEATER_BED_RAW_LO_TEMP 16383
254 254
   #else
@@ -257,7 +257,7 @@
257 257
   #endif
258 258
 #endif
259 259
 #ifndef HEATER_CHAMBER_RAW_HI_TEMP
260
-  #ifdef CHAMBER_USES_THERMISTOR
260
+  #ifdef HEATER_CHAMBER_USES_THERMISTOR
261 261
     #define HEATER_CHAMBER_RAW_HI_TEMP 0
262 262
     #define HEATER_CHAMBER_RAW_LO_TEMP 16383
263 263
   #else

Laddar…
Avbryt
Spara