Przeglądaj źródła

Use native ADC resolution where possible (#15719)

LinFor 5 lat temu
rodzic
commit
a84e3d1b80

+ 2
- 0
Marlin/src/HAL/HAL.h Wyświetl plik

@@ -25,6 +25,8 @@
25 25
 
26 26
 #include HAL_PATH(.,HAL.h)
27 27
 
28
+#define HAL_ADC_RANGE _BV(HAL_ADC_RESOLUTION)
29
+
28 30
 inline void watchdog_refresh() {
29 31
   #if ENABLED(USE_WATCHDOG)
30 32
     HAL_watchdog_refresh();

+ 1
- 0
Marlin/src/HAL/HAL_AVR/HAL.h Wyświetl plik

@@ -365,6 +365,7 @@ inline void HAL_adc_init() {
365 365
   #define HAL_START_ADC(pin) ADCSRB = 0; SET_ADMUX_ADCSRA(pin)
366 366
 #endif
367 367
 
368
+#define HAL_ADC_RESOLUTION 10
368 369
 #define HAL_READ_ADC()  ADC
369 370
 #define HAL_ADC_READY() !TEST(ADCSRA, ADSC)
370 371
 

+ 1
- 0
Marlin/src/HAL/HAL_DUE/HAL.h Wyświetl plik

@@ -133,6 +133,7 @@ extern uint16_t HAL_adc_result;     // result of last ADC conversion
133 133
 inline void HAL_adc_init() {}//todo
134 134
 
135 135
 #define HAL_START_ADC(pin)  HAL_adc_start_conversion(pin)
136
+#define HAL_ADC_RESOLUTION  10
136 137
 #define HAL_READ_ADC()      HAL_adc_result
137 138
 #define HAL_ADC_READY()     true
138 139
 

+ 1
- 0
Marlin/src/HAL/HAL_ESP32/HAL.h Wyświetl plik

@@ -111,6 +111,7 @@ void eeprom_update_block (const void *__src, void *__dst, size_t __n);
111 111
 void HAL_adc_init();
112 112
 
113 113
 #define HAL_START_ADC(pin)  HAL_adc_start_conversion(pin)
114
+#define HAL_ADC_RESOLUTION  10
114 115
 #define HAL_READ_ADC()      HAL_adc_result
115 116
 #define HAL_ADC_READY()     true
116 117
 

+ 1
- 0
Marlin/src/HAL/HAL_LINUX/HAL.h Wyświetl plik

@@ -89,6 +89,7 @@ int freeMemory();
89 89
 // ADC
90 90
 #define HAL_ANALOG_SELECT(pin) HAL_adc_enable_channel(pin)
91 91
 #define HAL_START_ADC(pin)     HAL_adc_start_conversion(pin)
92
+#define HAL_ADC_RESOLUTION     10
92 93
 #define HAL_READ_ADC()         HAL_adc_get_result()
93 94
 #define HAL_ADC_READY()        true
94 95
 

+ 5
- 2
Marlin/src/HAL/HAL_LPC1768/HAL.h Wyświetl plik

@@ -131,11 +131,14 @@ int freeMemory();
131 131
                                     // K = 6, 565 samples, 500Hz sample rate, 1.13s convergence on full range step
132 132
                                     // Memory usage per ADC channel (bytes): 4 (32 Bytes for 8 channels)
133 133
 
134
-using FilteredADC = LPC176x::ADC<ADC_LOWPASS_K_VALUE, ADC_MEDIAN_FILTER_SIZE>;
134
+#define HAL_ADC_RESULT_BITS    12   // 15 bit maximum, raw temperature is stored as int16_t
135
+#define HAL_ADC_FILTERED            // Disable oversampling done in Marlin as ADC values already filtered in HAL
136
+#define HAL_ADC_RESOLUTION     HAL_ADC_RESULT_BITS
135 137
 
138
+using FilteredADC = LPC176x::ADC<ADC_LOWPASS_K_VALUE, ADC_MEDIAN_FILTER_SIZE>;
136 139
 extern uint32_t HAL_adc_reading;
137 140
 [[gnu::always_inline]] inline void HAL_start_adc(const pin_t pin) {
138
-  HAL_adc_reading = FilteredADC::read(pin) >> 6; // returns 16bit value, reduce to 10bit
141
+  HAL_adc_reading = FilteredADC::read(pin) >> (16 - HAL_ADC_RESULT_BITS); // returns 16bit value, reduce to required bits
139 142
 }
140 143
 [[gnu::always_inline]] inline uint16_t HAL_read_adc() {
141 144
   return HAL_adc_reading;

+ 1
- 0
Marlin/src/HAL/HAL_SAMD51/HAL.h Wyświetl plik

@@ -110,6 +110,7 @@ extern uint16_t HAL_adc_result;     // result of last ADC conversion
110 110
 void HAL_adc_init();
111 111
 
112 112
 #define HAL_START_ADC(pin)  HAL_adc_start_conversion(pin)
113
+#define HAL_ADC_RESOLUTION  10
113 114
 #define HAL_READ_ADC()      HAL_adc_result
114 115
 #define HAL_ADC_READY()     true
115 116
 

+ 1
- 0
Marlin/src/HAL/HAL_STM32/HAL.h Wyświetl plik

@@ -188,6 +188,7 @@ void eeprom_update_block(const void *__src, void *__dst, size_t __n);
188 188
 inline void HAL_adc_init() {}
189 189
 
190 190
 #define HAL_START_ADC(pin)  HAL_adc_start_conversion(pin)
191
+#define HAL_ADC_RESOLUTION  10
191 192
 #define HAL_READ_ADC()      HAL_adc_result
192 193
 #define HAL_ADC_READY()     true
193 194
 

+ 1
- 0
Marlin/src/HAL/HAL_STM32F1/HAL.h Wyświetl plik

@@ -238,6 +238,7 @@ void eeprom_update_block(const void *__src, void *__dst, size_t __n);
238 238
 void HAL_adc_init();
239 239
 
240 240
 #define HAL_START_ADC(pin)  HAL_adc_start_conversion(pin)
241
+#define HAL_ADC_RESOLUTION  10
241 242
 #define HAL_READ_ADC()      HAL_adc_result
242 243
 #define HAL_ADC_READY()     true
243 244
 

+ 1
- 0
Marlin/src/HAL/HAL_STM32_F4_F7/HAL.h Wyświetl plik

@@ -208,6 +208,7 @@ void eeprom_update_block (const void *__src, void *__dst, size_t __n);
208 208
 inline void HAL_adc_init() {}
209 209
 
210 210
 #define HAL_START_ADC(pin)  HAL_adc_start_conversion(pin)
211
+#define HAL_ADC_RESOLUTION  10
211 212
 #define HAL_READ_ADC()      HAL_adc_result
212 213
 #define HAL_ADC_READY()     true
213 214
 

+ 1
- 0
Marlin/src/HAL/HAL_TEENSY31_32/HAL.h Wyświetl plik

@@ -109,6 +109,7 @@ extern "C" {
109 109
 void HAL_adc_init();
110 110
 
111 111
 #define HAL_START_ADC(pin)  HAL_adc_start_conversion(pin)
112
+#define HAL_ADC_RESOLUTION  10
112 113
 #define HAL_READ_ADC()      HAL_adc_get_result()
113 114
 #define HAL_ADC_READY()     true
114 115
 

+ 1
- 0
Marlin/src/HAL/HAL_TEENSY35_36/HAL.h Wyświetl plik

@@ -115,6 +115,7 @@ extern "C" {
115 115
 void HAL_adc_init();
116 116
 
117 117
 #define HAL_START_ADC(pin)  HAL_adc_start_conversion(pin)
118
+#define HAL_ADC_RESOLUTION  10
118 119
 #define HAL_READ_ADC()      HAL_adc_get_result()
119 120
 #define HAL_ADC_READY()     true
120 121
 

+ 2
- 1
Marlin/src/feature/filwidth.h Wyświetl plik

@@ -23,6 +23,7 @@
23 23
 
24 24
 #include "../inc/MarlinConfig.h"
25 25
 #include "../module/planner.h"
26
+#include "../module/thermistor/thermistors.h"
26 27
 
27 28
 class FilamentWidthSensor {
28 29
 public:
@@ -66,7 +67,7 @@ public:
66 67
   }
67 68
 
68 69
   // Convert raw measurement to mm
69
-  static inline float raw_to_mm(const uint16_t v) { return v * 5.0f * RECIPROCAL(16383.0f); }
70
+  static inline float raw_to_mm(const uint16_t v) { return v * 5.0f * RECIPROCAL(float(MAX_RAW_THERMISTOR_VALUE)); }
70 71
   static inline float raw_to_mm() { return raw_to_mm(raw); }
71 72
 
72 73
   // A scaled reading is ready

+ 23
- 17
Marlin/src/lcd/ultralcd.cpp Wyświetl plik

@@ -103,6 +103,10 @@
103 103
   #include "../feature/tmc_util.h"
104 104
 #endif
105 105
 
106
+#if HAS_ADC_BUTTONS
107
+  #include "../module/thermistor/thermistors.h"
108
+#endif
109
+
106 110
 #if HAS_ENCODER_ACTION
107 111
   volatile uint8_t MarlinUI::buttons;
108 112
   #if HAS_SLOW_BUTTONS
@@ -1102,31 +1106,33 @@ void MarlinUI::update() {
1102 1106
   #endif
1103 1107
 
1104 1108
   // Calculate the ADC value for the voltage divider with specified pull-down resistor value
1105
-  #define ADC_BUTTON_VALUE(r)  (int(4096.0 * (ADC_BUTTONS_VALUE_SCALE) * r / (r + ADC_BUTTONS_R_PULLUP)))
1109
+  #define ADC_BUTTON_VALUE(r)  int(HAL_ADC_RANGE * (ADC_BUTTONS_VALUE_SCALE) * r / (r + ADC_BUTTONS_R_PULLUP))
1106 1110
 
1111
+  static constexpr uint16_t adc_button_tolerance = HAL_ADC_RANGE *   25 / 1024,
1112
+                                adc_other_button = HAL_ADC_RANGE * 1000 / 1024;
1107 1113
   static const _stADCKeypadTable_ stADCKeyTable[] PROGMEM = {
1108 1114
     // VALUE_MIN, VALUE_MAX, KEY
1109
-    { 4000, 4096, 1 + BLEN_KEYPAD_F1     }, // F1
1110
-    { 4000, 4096, 1 + BLEN_KEYPAD_F2     }, // F2
1111
-    { 4000, 4096, 1 + BLEN_KEYPAD_F3     }, // F3
1112
-    {  ADC_BUTTON_VALUE(ADC_BUTTONS_LEFT_R_PULLDOWN)   - 100,
1113
-       ADC_BUTTON_VALUE(ADC_BUTTONS_LEFT_R_PULLDOWN)   + 100, 1 + BLEN_KEYPAD_LEFT   }, // LEFT  ( 272 ...  472)
1114
-    {  ADC_BUTTON_VALUE(ADC_BUTTONS_RIGHT_R_PULLDOWN)  - 100,
1115
-       ADC_BUTTON_VALUE(ADC_BUTTONS_RIGHT_R_PULLDOWN)  + 100, 1 + BLEN_KEYPAD_RIGHT  }, // RIGHT (1948 ... 2148)
1116
-    {  ADC_BUTTON_VALUE(ADC_BUTTONS_UP_R_PULLDOWN)     - 100,
1117
-       ADC_BUTTON_VALUE(ADC_BUTTONS_UP_R_PULLDOWN)     + 100, 1 + BLEN_KEYPAD_UP     }, // UP    ( 618 ...  818)
1118
-    {  ADC_BUTTON_VALUE(ADC_BUTTONS_DOWN_R_PULLDOWN)   - 100,
1119
-       ADC_BUTTON_VALUE(ADC_BUTTONS_DOWN_R_PULLDOWN)   + 100, 1 + BLEN_KEYPAD_DOWN   }, // DOWN  (2686 ... 2886)
1120
-    {  ADC_BUTTON_VALUE(ADC_BUTTONS_MIDDLE_R_PULLDOWN) - 100,
1121
-       ADC_BUTTON_VALUE(ADC_BUTTONS_MIDDLE_R_PULLDOWN) + 100, 1 + BLEN_KEYPAD_MIDDLE }, // ENTER (1205 ... 1405)
1115
+    { adc_other_button, HAL_ADC_RANGE, 1 + BLEN_KEYPAD_F1     }, // F1
1116
+    { adc_other_button, HAL_ADC_RANGE, 1 + BLEN_KEYPAD_F2     }, // F2
1117
+    { adc_other_button, HAL_ADC_RANGE, 1 + BLEN_KEYPAD_F3     }, // F3
1118
+    {  ADC_BUTTON_VALUE(ADC_BUTTONS_LEFT_R_PULLDOWN)   - adc_button_tolerance,
1119
+       ADC_BUTTON_VALUE(ADC_BUTTONS_LEFT_R_PULLDOWN)   + adc_button_tolerance, 1 + BLEN_KEYPAD_LEFT   }, // LEFT  ( 272 ...  472)
1120
+    {  ADC_BUTTON_VALUE(ADC_BUTTONS_RIGHT_R_PULLDOWN)  - adc_button_tolerance,
1121
+       ADC_BUTTON_VALUE(ADC_BUTTONS_RIGHT_R_PULLDOWN)  + adc_button_tolerance, 1 + BLEN_KEYPAD_RIGHT  }, // RIGHT (1948 ... 2148)
1122
+    {  ADC_BUTTON_VALUE(ADC_BUTTONS_UP_R_PULLDOWN)     - adc_button_tolerance,
1123
+       ADC_BUTTON_VALUE(ADC_BUTTONS_UP_R_PULLDOWN)     + adc_button_tolerance, 1 + BLEN_KEYPAD_UP     }, // UP    ( 618 ...  818)
1124
+    {  ADC_BUTTON_VALUE(ADC_BUTTONS_DOWN_R_PULLDOWN)   - adc_button_tolerance,
1125
+       ADC_BUTTON_VALUE(ADC_BUTTONS_DOWN_R_PULLDOWN)   + adc_button_tolerance, 1 + BLEN_KEYPAD_DOWN   }, // DOWN  (2686 ... 2886)
1126
+    {  ADC_BUTTON_VALUE(ADC_BUTTONS_MIDDLE_R_PULLDOWN) - adc_button_tolerance,
1127
+       ADC_BUTTON_VALUE(ADC_BUTTONS_MIDDLE_R_PULLDOWN) + adc_button_tolerance, 1 + BLEN_KEYPAD_MIDDLE }, // ENTER (1205 ... 1405)
1122 1128
   };
1123 1129
 
1124 1130
   uint8_t get_ADC_keyValue() {
1125 1131
     if (thermalManager.ADCKey_count >= 16) {
1126
-      const uint16_t currentkpADCValue = thermalManager.current_ADCKey_raw << 2;
1127
-      thermalManager.current_ADCKey_raw = 1024;
1132
+      const uint16_t currentkpADCValue = thermalManager.current_ADCKey_raw;
1133
+      thermalManager.current_ADCKey_raw = HAL_ADC_RANGE;
1128 1134
       thermalManager.ADCKey_count = 0;
1129
-      if (currentkpADCValue < 4000)
1135
+      if (currentkpADCValue < adc_other_button)
1130 1136
         for (uint8_t i = 0; i < ADC_KEY_NUM; i++) {
1131 1137
           const uint16_t lo = pgm_read_word(&stADCKeyTable[i].ADCKeyValueMin),
1132 1138
                          hi = pgm_read_word(&stADCKeyTable[i].ADCKeyValueMax);

+ 4
- 4
Marlin/src/module/temperature.cpp Wyświetl plik

@@ -302,7 +302,7 @@ volatile bool Temperature::temp_meas_ready = false;
302 302
 // public:
303 303
 
304 304
 #if HAS_ADC_BUTTONS
305
-  uint32_t Temperature::current_ADCKey_raw = 1024;
305
+  uint32_t Temperature::current_ADCKey_raw = HAL_ADC_RANGE;
306 306
   uint8_t Temperature::ADCKey_count = 0;
307 307
 #endif
308 308
 
@@ -1308,7 +1308,7 @@ void Temperature::manage_heater() {
1308 1308
     }
1309 1309
 
1310 1310
     // maximum adc value .. take into account the over sampling
1311
-    const int adc_max = (THERMISTOR_ADC_RESOLUTION * OVERSAMPLENR) - 1,
1311
+    const int adc_max = MAX_RAW_THERMISTOR_VALUE,
1312 1312
               adc_raw = constrain(raw, 1, adc_max - 1); // constrain to prevent divide-by-zero
1313 1313
 
1314 1314
     const float adc_inverse = (adc_max - adc_raw) - 0.5f,
@@ -2742,7 +2742,7 @@ void Temperature::isr() {
2742 2742
           next_sensor_state = adc_sensor_state; // redo this state
2743 2743
         else if (ADCKey_count < 16) {
2744 2744
           raw_ADCKey_value = HAL_READ_ADC();
2745
-          if (raw_ADCKey_value <= 900) {
2745
+          if (raw_ADCKey_value <= 900UL * HAL_ADC_RANGE / 1024UL) {
2746 2746
             NOMORE(current_ADCKey_raw, raw_ADCKey_value);
2747 2747
             ADCKey_count++;
2748 2748
           }
@@ -2750,7 +2750,7 @@ void Temperature::isr() {
2750 2750
             if (ADCKey_count > 0) ADCKey_count++; else ADCKey_pressed = false;
2751 2751
             if (ADCKey_pressed) {
2752 2752
               ADCKey_count = 0;
2753
-              current_ADCKey_raw = 1024;
2753
+              current_ADCKey_raw = HAL_ADC_RANGE;
2754 2754
             }
2755 2755
           }
2756 2756
         }

+ 0
- 1
Marlin/src/module/temperature.h Wyświetl plik

@@ -217,7 +217,6 @@ typedef struct { int16_t raw_min, raw_max; } raw_range_t;
217 217
 typedef struct { int16_t mintemp, maxtemp; } celsius_range_t;
218 218
 typedef struct { int16_t raw_min, raw_max, mintemp, maxtemp; } temp_range_t;
219 219
 
220
-#define THERMISTOR_ADC_RESOLUTION       1024           // 10-bit ADC .. shame to waste 12-bits of resolution on 32-bit
221 220
 #define THERMISTOR_ABS_ZERO_C           -273.15f       // bbbbrrrrr cold !
222 221
 #define THERMISTOR_RESISTANCE_NOMINAL_C 25.0f          // mmmmm comfortable
223 222
 

+ 31
- 18
Marlin/src/module/thermistor/thermistors.h Wyświetl plik

@@ -23,8 +23,21 @@
23 23
 
24 24
 #include "../../inc/MarlinConfig.h"
25 25
 
26
-#define OVERSAMPLENR 16
27
-#define OV(N) int16_t((N) * (OVERSAMPLENR))
26
+#define THERMISTOR_TABLE_ADC_RESOLUTION 1024
27
+#define THERMISTOR_TABLE_SCALE (HAL_ADC_RANGE / (THERMISTOR_TABLE_ADC_RESOLUTION))
28
+#if ENABLED(HAL_ADC_FILTERED)
29
+  #define OVERSAMPLENR 1
30
+#else
31
+  #define OVERSAMPLENR 16
32
+#endif
33
+#define MAX_RAW_THERMISTOR_VALUE (HAL_ADC_RANGE * (OVERSAMPLENR) - 1)
34
+
35
+// Currently Marlin stores all oversampled ADC values as int16_t, make sure the HAL settings do not overflow 15bit
36
+#if MAX_RAW_THERMISTOR_VALUE > ((1 << 15) - 1)
37
+  #error "MAX_RAW_THERMISTOR_VALUE is too large for int16_t. Reduce OVERSAMPLENR or HAL_ADC_RESOLUTION."
38
+#endif
39
+
40
+#define OV(N) int16_t((N) * (OVERSAMPLENR) * (THERMISTOR_TABLE_SCALE))
28 41
 
29 42
 #define ANY_THERMISTOR_IS(n) (THERMISTOR_HEATER_0 == n || THERMISTOR_HEATER_1 == n || THERMISTOR_HEATER_2 == n || THERMISTOR_HEATER_3 == n || THERMISTOR_HEATER_4 == n || THERMISTOR_HEATER_5 == n || THERMISTORBED == n || THERMISTORCHAMBER == n)
30 43
 
@@ -251,74 +264,74 @@ static_assert(
251 264
 // For thermocouples the highest temperature results in the highest ADC value
252 265
 #ifndef HEATER_0_RAW_HI_TEMP
253 266
   #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_0_USES_THERMISTOR)
254
-    #define HEATER_0_RAW_HI_TEMP 16383
267
+    #define HEATER_0_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
255 268
     #define HEATER_0_RAW_LO_TEMP 0
256 269
   #else
257 270
     #define HEATER_0_RAW_HI_TEMP 0
258
-    #define HEATER_0_RAW_LO_TEMP 16383
271
+    #define HEATER_0_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
259 272
   #endif
260 273
 #endif
261 274
 #ifndef HEATER_1_RAW_HI_TEMP
262 275
   #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_1_USES_THERMISTOR)
263
-    #define HEATER_1_RAW_HI_TEMP 16383
276
+    #define HEATER_1_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
264 277
     #define HEATER_1_RAW_LO_TEMP 0
265 278
   #else
266 279
     #define HEATER_1_RAW_HI_TEMP 0
267
-    #define HEATER_1_RAW_LO_TEMP 16383
280
+    #define HEATER_1_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
268 281
   #endif
269 282
 #endif
270 283
 #ifndef HEATER_2_RAW_HI_TEMP
271 284
   #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_2_USES_THERMISTOR)
272
-    #define HEATER_2_RAW_HI_TEMP 16383
285
+    #define HEATER_2_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
273 286
     #define HEATER_2_RAW_LO_TEMP 0
274 287
   #else
275 288
     #define HEATER_2_RAW_HI_TEMP 0
276
-    #define HEATER_2_RAW_LO_TEMP 16383
289
+    #define HEATER_2_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
277 290
   #endif
278 291
 #endif
279 292
 #ifndef HEATER_3_RAW_HI_TEMP
280 293
   #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_3_USES_THERMISTOR)
281
-    #define HEATER_3_RAW_HI_TEMP 16383
294
+    #define HEATER_3_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
282 295
     #define HEATER_3_RAW_LO_TEMP 0
283 296
   #else
284 297
     #define HEATER_3_RAW_HI_TEMP 0
285
-    #define HEATER_3_RAW_LO_TEMP 16383
298
+    #define HEATER_3_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
286 299
   #endif
287 300
 #endif
288 301
 #ifndef HEATER_4_RAW_HI_TEMP
289 302
   #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_4_USES_THERMISTOR)
290
-    #define HEATER_4_RAW_HI_TEMP 16383
303
+    #define HEATER_4_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
291 304
     #define HEATER_4_RAW_LO_TEMP 0
292 305
   #else
293 306
     #define HEATER_4_RAW_HI_TEMP 0
294
-    #define HEATER_4_RAW_LO_TEMP 16383
307
+    #define HEATER_4_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
295 308
   #endif
296 309
 #endif
297 310
 #ifndef HEATER_5_RAW_HI_TEMP
298 311
   #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_5_USES_THERMISTOR)
299
-    #define HEATER_5_RAW_HI_TEMP 16383
312
+    #define HEATER_5_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
300 313
     #define HEATER_5_RAW_LO_TEMP 0
301 314
   #else
302 315
     #define HEATER_5_RAW_HI_TEMP 0
303
-    #define HEATER_5_RAW_LO_TEMP 16383
316
+    #define HEATER_5_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
304 317
   #endif
305 318
 #endif
306 319
 #ifndef HEATER_BED_RAW_HI_TEMP
307 320
   #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_BED_USES_THERMISTOR)
308
-    #define HEATER_BED_RAW_HI_TEMP 16383
321
+    #define HEATER_BED_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
309 322
     #define HEATER_BED_RAW_LO_TEMP 0
310 323
   #else
311 324
     #define HEATER_BED_RAW_HI_TEMP 0
312
-    #define HEATER_BED_RAW_LO_TEMP 16383
325
+    #define HEATER_BED_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
313 326
   #endif
314 327
 #endif
315 328
 #ifndef HEATER_CHAMBER_RAW_HI_TEMP
316 329
   #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_CHAMBER_USES_THERMISTOR)
317
-    #define HEATER_CHAMBER_RAW_HI_TEMP 16383
330
+    #define HEATER_CHAMBER_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
318 331
     #define HEATER_CHAMBER_RAW_LO_TEMP 0
319 332
   #else
320 333
     #define HEATER_CHAMBER_RAW_HI_TEMP 0
321
-    #define HEATER_CHAMBER_RAW_LO_TEMP 16383
334
+    #define HEATER_CHAMBER_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
322 335
   #endif
323 336
 #endif
324 337
 

Ładowanie…
Anuluj
Zapisz