Pārlūkot izejas kodu

Use native ADC resolution where possible (#15719)

LinFor 5 gadus atpakaļ
vecāks
revīzija
a84e3d1b80

+ 2
- 0
Marlin/src/HAL/HAL.h Parādīt failu

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

+ 1
- 0
Marlin/src/HAL/HAL_AVR/HAL.h Parādīt failu

365
   #define HAL_START_ADC(pin) ADCSRB = 0; SET_ADMUX_ADCSRA(pin)
365
   #define HAL_START_ADC(pin) ADCSRB = 0; SET_ADMUX_ADCSRA(pin)
366
 #endif
366
 #endif
367
 
367
 
368
+#define HAL_ADC_RESOLUTION 10
368
 #define HAL_READ_ADC()  ADC
369
 #define HAL_READ_ADC()  ADC
369
 #define HAL_ADC_READY() !TEST(ADCSRA, ADSC)
370
 #define HAL_ADC_READY() !TEST(ADCSRA, ADSC)
370
 
371
 

+ 1
- 0
Marlin/src/HAL/HAL_DUE/HAL.h Parādīt failu

133
 inline void HAL_adc_init() {}//todo
133
 inline void HAL_adc_init() {}//todo
134
 
134
 
135
 #define HAL_START_ADC(pin)  HAL_adc_start_conversion(pin)
135
 #define HAL_START_ADC(pin)  HAL_adc_start_conversion(pin)
136
+#define HAL_ADC_RESOLUTION  10
136
 #define HAL_READ_ADC()      HAL_adc_result
137
 #define HAL_READ_ADC()      HAL_adc_result
137
 #define HAL_ADC_READY()     true
138
 #define HAL_ADC_READY()     true
138
 
139
 

+ 1
- 0
Marlin/src/HAL/HAL_ESP32/HAL.h Parādīt failu

111
 void HAL_adc_init();
111
 void HAL_adc_init();
112
 
112
 
113
 #define HAL_START_ADC(pin)  HAL_adc_start_conversion(pin)
113
 #define HAL_START_ADC(pin)  HAL_adc_start_conversion(pin)
114
+#define HAL_ADC_RESOLUTION  10
114
 #define HAL_READ_ADC()      HAL_adc_result
115
 #define HAL_READ_ADC()      HAL_adc_result
115
 #define HAL_ADC_READY()     true
116
 #define HAL_ADC_READY()     true
116
 
117
 

+ 1
- 0
Marlin/src/HAL/HAL_LINUX/HAL.h Parādīt failu

89
 // ADC
89
 // ADC
90
 #define HAL_ANALOG_SELECT(pin) HAL_adc_enable_channel(pin)
90
 #define HAL_ANALOG_SELECT(pin) HAL_adc_enable_channel(pin)
91
 #define HAL_START_ADC(pin)     HAL_adc_start_conversion(pin)
91
 #define HAL_START_ADC(pin)     HAL_adc_start_conversion(pin)
92
+#define HAL_ADC_RESOLUTION     10
92
 #define HAL_READ_ADC()         HAL_adc_get_result()
93
 #define HAL_READ_ADC()         HAL_adc_get_result()
93
 #define HAL_ADC_READY()        true
94
 #define HAL_ADC_READY()        true
94
 
95
 

+ 5
- 2
Marlin/src/HAL/HAL_LPC1768/HAL.h Parādīt failu

131
                                     // K = 6, 565 samples, 500Hz sample rate, 1.13s convergence on full range step
131
                                     // K = 6, 565 samples, 500Hz sample rate, 1.13s convergence on full range step
132
                                     // Memory usage per ADC channel (bytes): 4 (32 Bytes for 8 channels)
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
 extern uint32_t HAL_adc_reading;
139
 extern uint32_t HAL_adc_reading;
137
 [[gnu::always_inline]] inline void HAL_start_adc(const pin_t pin) {
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
 [[gnu::always_inline]] inline uint16_t HAL_read_adc() {
143
 [[gnu::always_inline]] inline uint16_t HAL_read_adc() {
141
   return HAL_adc_reading;
144
   return HAL_adc_reading;

+ 1
- 0
Marlin/src/HAL/HAL_SAMD51/HAL.h Parādīt failu

110
 void HAL_adc_init();
110
 void HAL_adc_init();
111
 
111
 
112
 #define HAL_START_ADC(pin)  HAL_adc_start_conversion(pin)
112
 #define HAL_START_ADC(pin)  HAL_adc_start_conversion(pin)
113
+#define HAL_ADC_RESOLUTION  10
113
 #define HAL_READ_ADC()      HAL_adc_result
114
 #define HAL_READ_ADC()      HAL_adc_result
114
 #define HAL_ADC_READY()     true
115
 #define HAL_ADC_READY()     true
115
 
116
 

+ 1
- 0
Marlin/src/HAL/HAL_STM32/HAL.h Parādīt failu

188
 inline void HAL_adc_init() {}
188
 inline void HAL_adc_init() {}
189
 
189
 
190
 #define HAL_START_ADC(pin)  HAL_adc_start_conversion(pin)
190
 #define HAL_START_ADC(pin)  HAL_adc_start_conversion(pin)
191
+#define HAL_ADC_RESOLUTION  10
191
 #define HAL_READ_ADC()      HAL_adc_result
192
 #define HAL_READ_ADC()      HAL_adc_result
192
 #define HAL_ADC_READY()     true
193
 #define HAL_ADC_READY()     true
193
 
194
 

+ 1
- 0
Marlin/src/HAL/HAL_STM32F1/HAL.h Parādīt failu

238
 void HAL_adc_init();
238
 void HAL_adc_init();
239
 
239
 
240
 #define HAL_START_ADC(pin)  HAL_adc_start_conversion(pin)
240
 #define HAL_START_ADC(pin)  HAL_adc_start_conversion(pin)
241
+#define HAL_ADC_RESOLUTION  10
241
 #define HAL_READ_ADC()      HAL_adc_result
242
 #define HAL_READ_ADC()      HAL_adc_result
242
 #define HAL_ADC_READY()     true
243
 #define HAL_ADC_READY()     true
243
 
244
 

+ 1
- 0
Marlin/src/HAL/HAL_STM32_F4_F7/HAL.h Parādīt failu

208
 inline void HAL_adc_init() {}
208
 inline void HAL_adc_init() {}
209
 
209
 
210
 #define HAL_START_ADC(pin)  HAL_adc_start_conversion(pin)
210
 #define HAL_START_ADC(pin)  HAL_adc_start_conversion(pin)
211
+#define HAL_ADC_RESOLUTION  10
211
 #define HAL_READ_ADC()      HAL_adc_result
212
 #define HAL_READ_ADC()      HAL_adc_result
212
 #define HAL_ADC_READY()     true
213
 #define HAL_ADC_READY()     true
213
 
214
 

+ 1
- 0
Marlin/src/HAL/HAL_TEENSY31_32/HAL.h Parādīt failu

109
 void HAL_adc_init();
109
 void HAL_adc_init();
110
 
110
 
111
 #define HAL_START_ADC(pin)  HAL_adc_start_conversion(pin)
111
 #define HAL_START_ADC(pin)  HAL_adc_start_conversion(pin)
112
+#define HAL_ADC_RESOLUTION  10
112
 #define HAL_READ_ADC()      HAL_adc_get_result()
113
 #define HAL_READ_ADC()      HAL_adc_get_result()
113
 #define HAL_ADC_READY()     true
114
 #define HAL_ADC_READY()     true
114
 
115
 

+ 1
- 0
Marlin/src/HAL/HAL_TEENSY35_36/HAL.h Parādīt failu

115
 void HAL_adc_init();
115
 void HAL_adc_init();
116
 
116
 
117
 #define HAL_START_ADC(pin)  HAL_adc_start_conversion(pin)
117
 #define HAL_START_ADC(pin)  HAL_adc_start_conversion(pin)
118
+#define HAL_ADC_RESOLUTION  10
118
 #define HAL_READ_ADC()      HAL_adc_get_result()
119
 #define HAL_READ_ADC()      HAL_adc_get_result()
119
 #define HAL_ADC_READY()     true
120
 #define HAL_ADC_READY()     true
120
 
121
 

+ 2
- 1
Marlin/src/feature/filwidth.h Parādīt failu

23
 
23
 
24
 #include "../inc/MarlinConfig.h"
24
 #include "../inc/MarlinConfig.h"
25
 #include "../module/planner.h"
25
 #include "../module/planner.h"
26
+#include "../module/thermistor/thermistors.h"
26
 
27
 
27
 class FilamentWidthSensor {
28
 class FilamentWidthSensor {
28
 public:
29
 public:
66
   }
67
   }
67
 
68
 
68
   // Convert raw measurement to mm
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
   static inline float raw_to_mm() { return raw_to_mm(raw); }
71
   static inline float raw_to_mm() { return raw_to_mm(raw); }
71
 
72
 
72
   // A scaled reading is ready
73
   // A scaled reading is ready

+ 23
- 17
Marlin/src/lcd/ultralcd.cpp Parādīt failu

103
   #include "../feature/tmc_util.h"
103
   #include "../feature/tmc_util.h"
104
 #endif
104
 #endif
105
 
105
 
106
+#if HAS_ADC_BUTTONS
107
+  #include "../module/thermistor/thermistors.h"
108
+#endif
109
+
106
 #if HAS_ENCODER_ACTION
110
 #if HAS_ENCODER_ACTION
107
   volatile uint8_t MarlinUI::buttons;
111
   volatile uint8_t MarlinUI::buttons;
108
   #if HAS_SLOW_BUTTONS
112
   #if HAS_SLOW_BUTTONS
1102
   #endif
1106
   #endif
1103
 
1107
 
1104
   // Calculate the ADC value for the voltage divider with specified pull-down resistor value
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
   static const _stADCKeypadTable_ stADCKeyTable[] PROGMEM = {
1113
   static const _stADCKeypadTable_ stADCKeyTable[] PROGMEM = {
1108
     // VALUE_MIN, VALUE_MAX, KEY
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
   uint8_t get_ADC_keyValue() {
1130
   uint8_t get_ADC_keyValue() {
1125
     if (thermalManager.ADCKey_count >= 16) {
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
       thermalManager.ADCKey_count = 0;
1134
       thermalManager.ADCKey_count = 0;
1129
-      if (currentkpADCValue < 4000)
1135
+      if (currentkpADCValue < adc_other_button)
1130
         for (uint8_t i = 0; i < ADC_KEY_NUM; i++) {
1136
         for (uint8_t i = 0; i < ADC_KEY_NUM; i++) {
1131
           const uint16_t lo = pgm_read_word(&stADCKeyTable[i].ADCKeyValueMin),
1137
           const uint16_t lo = pgm_read_word(&stADCKeyTable[i].ADCKeyValueMin),
1132
                          hi = pgm_read_word(&stADCKeyTable[i].ADCKeyValueMax);
1138
                          hi = pgm_read_word(&stADCKeyTable[i].ADCKeyValueMax);

+ 4
- 4
Marlin/src/module/temperature.cpp Parādīt failu

302
 // public:
302
 // public:
303
 
303
 
304
 #if HAS_ADC_BUTTONS
304
 #if HAS_ADC_BUTTONS
305
-  uint32_t Temperature::current_ADCKey_raw = 1024;
305
+  uint32_t Temperature::current_ADCKey_raw = HAL_ADC_RANGE;
306
   uint8_t Temperature::ADCKey_count = 0;
306
   uint8_t Temperature::ADCKey_count = 0;
307
 #endif
307
 #endif
308
 
308
 
1308
     }
1308
     }
1309
 
1309
 
1310
     // maximum adc value .. take into account the over sampling
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
               adc_raw = constrain(raw, 1, adc_max - 1); // constrain to prevent divide-by-zero
1312
               adc_raw = constrain(raw, 1, adc_max - 1); // constrain to prevent divide-by-zero
1313
 
1313
 
1314
     const float adc_inverse = (adc_max - adc_raw) - 0.5f,
1314
     const float adc_inverse = (adc_max - adc_raw) - 0.5f,
2742
           next_sensor_state = adc_sensor_state; // redo this state
2742
           next_sensor_state = adc_sensor_state; // redo this state
2743
         else if (ADCKey_count < 16) {
2743
         else if (ADCKey_count < 16) {
2744
           raw_ADCKey_value = HAL_READ_ADC();
2744
           raw_ADCKey_value = HAL_READ_ADC();
2745
-          if (raw_ADCKey_value <= 900) {
2745
+          if (raw_ADCKey_value <= 900UL * HAL_ADC_RANGE / 1024UL) {
2746
             NOMORE(current_ADCKey_raw, raw_ADCKey_value);
2746
             NOMORE(current_ADCKey_raw, raw_ADCKey_value);
2747
             ADCKey_count++;
2747
             ADCKey_count++;
2748
           }
2748
           }
2750
             if (ADCKey_count > 0) ADCKey_count++; else ADCKey_pressed = false;
2750
             if (ADCKey_count > 0) ADCKey_count++; else ADCKey_pressed = false;
2751
             if (ADCKey_pressed) {
2751
             if (ADCKey_pressed) {
2752
               ADCKey_count = 0;
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 Parādīt failu

217
 typedef struct { int16_t mintemp, maxtemp; } celsius_range_t;
217
 typedef struct { int16_t mintemp, maxtemp; } celsius_range_t;
218
 typedef struct { int16_t raw_min, raw_max, mintemp, maxtemp; } temp_range_t;
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
 #define THERMISTOR_ABS_ZERO_C           -273.15f       // bbbbrrrrr cold !
220
 #define THERMISTOR_ABS_ZERO_C           -273.15f       // bbbbrrrrr cold !
222
 #define THERMISTOR_RESISTANCE_NOMINAL_C 25.0f          // mmmmm comfortable
221
 #define THERMISTOR_RESISTANCE_NOMINAL_C 25.0f          // mmmmm comfortable
223
 
222
 

+ 31
- 18
Marlin/src/module/thermistor/thermistors.h Parādīt failu

23
 
23
 
24
 #include "../../inc/MarlinConfig.h"
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
 #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)
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
 // For thermocouples the highest temperature results in the highest ADC value
264
 // For thermocouples the highest temperature results in the highest ADC value
252
 #ifndef HEATER_0_RAW_HI_TEMP
265
 #ifndef HEATER_0_RAW_HI_TEMP
253
   #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_0_USES_THERMISTOR)
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
     #define HEATER_0_RAW_LO_TEMP 0
268
     #define HEATER_0_RAW_LO_TEMP 0
256
   #else
269
   #else
257
     #define HEATER_0_RAW_HI_TEMP 0
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
   #endif
272
   #endif
260
 #endif
273
 #endif
261
 #ifndef HEATER_1_RAW_HI_TEMP
274
 #ifndef HEATER_1_RAW_HI_TEMP
262
   #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_1_USES_THERMISTOR)
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
     #define HEATER_1_RAW_LO_TEMP 0
277
     #define HEATER_1_RAW_LO_TEMP 0
265
   #else
278
   #else
266
     #define HEATER_1_RAW_HI_TEMP 0
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
   #endif
281
   #endif
269
 #endif
282
 #endif
270
 #ifndef HEATER_2_RAW_HI_TEMP
283
 #ifndef HEATER_2_RAW_HI_TEMP
271
   #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_2_USES_THERMISTOR)
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
     #define HEATER_2_RAW_LO_TEMP 0
286
     #define HEATER_2_RAW_LO_TEMP 0
274
   #else
287
   #else
275
     #define HEATER_2_RAW_HI_TEMP 0
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
   #endif
290
   #endif
278
 #endif
291
 #endif
279
 #ifndef HEATER_3_RAW_HI_TEMP
292
 #ifndef HEATER_3_RAW_HI_TEMP
280
   #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_3_USES_THERMISTOR)
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
     #define HEATER_3_RAW_LO_TEMP 0
295
     #define HEATER_3_RAW_LO_TEMP 0
283
   #else
296
   #else
284
     #define HEATER_3_RAW_HI_TEMP 0
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
   #endif
299
   #endif
287
 #endif
300
 #endif
288
 #ifndef HEATER_4_RAW_HI_TEMP
301
 #ifndef HEATER_4_RAW_HI_TEMP
289
   #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_4_USES_THERMISTOR)
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
     #define HEATER_4_RAW_LO_TEMP 0
304
     #define HEATER_4_RAW_LO_TEMP 0
292
   #else
305
   #else
293
     #define HEATER_4_RAW_HI_TEMP 0
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
   #endif
308
   #endif
296
 #endif
309
 #endif
297
 #ifndef HEATER_5_RAW_HI_TEMP
310
 #ifndef HEATER_5_RAW_HI_TEMP
298
   #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_5_USES_THERMISTOR)
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
     #define HEATER_5_RAW_LO_TEMP 0
313
     #define HEATER_5_RAW_LO_TEMP 0
301
   #else
314
   #else
302
     #define HEATER_5_RAW_HI_TEMP 0
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
   #endif
317
   #endif
305
 #endif
318
 #endif
306
 #ifndef HEATER_BED_RAW_HI_TEMP
319
 #ifndef HEATER_BED_RAW_HI_TEMP
307
   #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_BED_USES_THERMISTOR)
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
     #define HEATER_BED_RAW_LO_TEMP 0
322
     #define HEATER_BED_RAW_LO_TEMP 0
310
   #else
323
   #else
311
     #define HEATER_BED_RAW_HI_TEMP 0
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
   #endif
326
   #endif
314
 #endif
327
 #endif
315
 #ifndef HEATER_CHAMBER_RAW_HI_TEMP
328
 #ifndef HEATER_CHAMBER_RAW_HI_TEMP
316
   #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_CHAMBER_USES_THERMISTOR)
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
     #define HEATER_CHAMBER_RAW_LO_TEMP 0
331
     #define HEATER_CHAMBER_RAW_LO_TEMP 0
319
   #else
332
   #else
320
     #define HEATER_CHAMBER_RAW_HI_TEMP 0
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
   #endif
335
   #endif
323
 #endif
336
 #endif
324
 
337
 

Notiek ielāde…
Atcelt
Saglabāt