Browse Source

Fix User Temp Sensor (1000), reversed Pt100 / Pt1000 (#18590)

ellensp 5 years ago
parent
commit
c2e0e61fe8
No account linked to committer's email address

+ 2
- 2
Marlin/src/module/temperature.cpp View File

@@ -1800,13 +1800,13 @@ void Temperature::init() {
1800 1800
   #if HAS_HOTEND
1801 1801
 
1802 1802
     #define _TEMP_MIN_E(NR) do{ \
1803
-      const int16_t tmin = _MAX(HEATER_ ##NR## _MINTEMP, (int16_t)pgm_read_word(&HEATER_ ##NR## _TEMPTABLE[HEATER_ ##NR## _SENSOR_MINTEMP_IND].celsius)); \
1803
+      const int16_t tmin = _MAX(HEATER_ ##NR## _MINTEMP, TERN(HEATER_##NR##_USER_THERMISTOR, 0, (int16_t)pgm_read_word(&HEATER_ ##NR## _TEMPTABLE[HEATER_ ##NR## _SENSOR_MINTEMP_IND].celsius))); \
1804 1804
       temp_range[NR].mintemp = tmin; \
1805 1805
       while (analog_to_celsius_hotend(temp_range[NR].raw_min, NR) < tmin) \
1806 1806
         temp_range[NR].raw_min += TEMPDIR(NR) * (OVERSAMPLENR); \
1807 1807
     }while(0)
1808 1808
     #define _TEMP_MAX_E(NR) do{ \
1809
-      const int16_t tmax = _MIN(HEATER_ ##NR## _MAXTEMP, (int16_t)pgm_read_word(&HEATER_ ##NR## _TEMPTABLE[HEATER_ ##NR## _SENSOR_MAXTEMP_IND].celsius) - 1); \
1809
+      const int16_t tmax = _MIN(HEATER_ ##NR## _MAXTEMP, TERN(HEATER_##NR##_USER_THERMISTOR, 2000, (int16_t)pgm_read_word(&HEATER_ ##NR## _TEMPTABLE[HEATER_ ##NR## _SENSOR_MAXTEMP_IND].celsius) - 1)); \
1810 1810
       temp_range[NR].maxtemp = tmax; \
1811 1811
       while (analog_to_celsius_hotend(temp_range[NR].raw_max, NR) > tmax) \
1812 1812
         temp_range[NR].raw_max -= TEMPDIR(NR) * (OVERSAMPLENR); \

+ 2
- 0
Marlin/src/module/thermistor/thermistor_1010.h View File

@@ -21,6 +21,8 @@
21 21
  */
22 22
 #pragma once
23 23
 
24
+#define REVERSE_TEMP_SENSOR_RANGE_1010 1
25
+
24 26
 // Pt1000 with 1k0 pullup
25 27
 const temp_entry_t temptable_1010[] PROGMEM = {
26 28
   PtLine(  0, 1000, 1000),

+ 2
- 0
Marlin/src/module/thermistor/thermistor_1047.h View File

@@ -21,6 +21,8 @@
21 21
  */
22 22
 #pragma once
23 23
 
24
+#define REVERSE_TEMP_SENSOR_RANGE_1047 1
25
+
24 26
 // Pt1000 with 4k7 pullup
25 27
 const temp_entry_t temptable_1047[] PROGMEM = {
26 28
   // only a few values are needed as the curve is very flat

+ 2
- 0
Marlin/src/module/thermistor/thermistor_110.h View File

@@ -21,6 +21,8 @@
21 21
  */
22 22
 #pragma once
23 23
 
24
+#define REVERSE_TEMP_SENSOR_RANGE_110 1
25
+
24 26
 // Pt100 with 1k0 pullup
25 27
 const temp_entry_t temptable_110[] PROGMEM = {
26 28
   // only a few values are needed as the curve is very flat

+ 2
- 0
Marlin/src/module/thermistor/thermistor_147.h View File

@@ -21,6 +21,8 @@
21 21
  */
22 22
 #pragma once
23 23
 
24
+#define REVERSE_TEMP_SENSOR_RANGE_147 1
25
+
24 26
 // Pt100 with 4k7 pullup
25 27
 const temp_entry_t temptable_147[] PROGMEM = {
26 28
   // only a few values are needed as the curve is very flat

Loading…
Cancel
Save