Browse Source

Fix thermistor table warning

Scott Lahteine 5 years ago
parent
commit
605ec0a478
2 changed files with 16 additions and 9 deletions
  1. 2
    2
      Marlin/src/module/temperature.cpp
  2. 14
    7
      Marlin/src/module/thermistor/thermistors.h

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

@@ -1431,7 +1431,7 @@ float Temperature::analog_to_celsius_hotend(const int raw, const uint8_t e) {
1431 1431
     #if ENABLED(BED_USER_THERMISTOR)
1432 1432
       return user_thermistor_to_deg_c(CTI_BED, raw);
1433 1433
     #elif ENABLED(HEATER_BED_USES_THERMISTOR)
1434
-      SCAN_THERMISTOR_TABLE(BEDTEMPTABLE, BEDTEMPTABLE_LEN);
1434
+      SCAN_THERMISTOR_TABLE(BED_TEMPTABLE, BED_TEMPTABLE_LEN);
1435 1435
     #elif ENABLED(HEATER_BED_USES_AD595)
1436 1436
       return TEMP_AD595(raw);
1437 1437
     #elif ENABLED(HEATER_BED_USES_AD8495)
@@ -1449,7 +1449,7 @@ float Temperature::analog_to_celsius_hotend(const int raw, const uint8_t e) {
1449 1449
     #if ENABLED(CHAMBER_USER_THERMISTOR)
1450 1450
       return user_thermistor_to_deg_c(CTI_CHAMBER, raw);
1451 1451
     #elif ENABLED(HEATER_CHAMBER_USES_THERMISTOR)
1452
-      SCAN_THERMISTOR_TABLE(CHAMBERTEMPTABLE, CHAMBERTEMPTABLE_LEN);
1452
+      SCAN_THERMISTOR_TABLE(CHAMBER_TEMPTABLE, CHAMBER_TEMPTABLE_LEN);
1453 1453
     #elif ENABLED(HEATER_CHAMBER_USES_AD595)
1454 1454
       return TEMP_AD595(raw);
1455 1455
     #elif ENABLED(HEATER_CHAMBER_USES_AD8495)

+ 14
- 7
Marlin/src/module/thermistor/thermistors.h View File

@@ -137,6 +137,9 @@
137 137
 #if ANY_THERMISTOR_IS(999) // User-defined table 2
138 138
   #include "thermistor_999.h"
139 139
 #endif
140
+#if ANY_THERMISTOR_IS(1000) // Custom
141
+  const short temptable_1000[][2] PROGMEM = { { 0, 0 } };
142
+#endif
140 143
 
141 144
 #define _TT_NAME(_N) temptable_ ## _N
142 145
 #define TT_NAME(_N) _TT_NAME(_N)
@@ -202,25 +205,29 @@
202 205
 #endif
203 206
 
204 207
 #ifdef THERMISTORBED
205
-  #define BEDTEMPTABLE TT_NAME(THERMISTORBED)
206
-  #define BEDTEMPTABLE_LEN COUNT(BEDTEMPTABLE)
208
+  #define BED_TEMPTABLE TT_NAME(THERMISTORBED)
209
+  #define BED_TEMPTABLE_LEN COUNT(BED_TEMPTABLE)
207 210
 #elif defined(HEATER_BED_USES_THERMISTOR)
208 211
   #error "No bed thermistor table specified"
209 212
 #else
210
-  #define BEDTEMPTABLE_LEN 0
213
+  #define BED_TEMPTABLE_LEN 0
211 214
 #endif
212 215
 
213 216
 #ifdef THERMISTORCHAMBER
214
-  #define CHAMBERTEMPTABLE TT_NAME(THERMISTORCHAMBER)
215
-  #define CHAMBERTEMPTABLE_LEN COUNT(CHAMBERTEMPTABLE)
217
+  #define CHAMBER_TEMPTABLE TT_NAME(THERMISTORCHAMBER)
218
+  #define CHAMBER_TEMPTABLE_LEN COUNT(CHAMBER_TEMPTABLE)
216 219
 #elif defined(HEATER_CHAMBER_USES_THERMISTOR)
217 220
   #error "No chamber thermistor table specified"
218 221
 #else
219
-  #define CHAMBERTEMPTABLE_LEN 0
222
+  #define CHAMBER_TEMPTABLE_LEN 0
220 223
 #endif
221 224
 
222 225
 // The SCAN_THERMISTOR_TABLE macro needs alteration?
223
-static_assert(HEATER_0_TEMPTABLE_LEN < 256 && HEATER_1_TEMPTABLE_LEN < 256 && HEATER_2_TEMPTABLE_LEN < 256 && HEATER_3_TEMPTABLE_LEN < 256 && HEATER_4_TEMPTABLE_LEN < 256 && BEDTEMPTABLE_LEN < 256 && CHAMBERTEMPTABLE_LEN < 256,
226
+static_assert(
227
+     HEATER_0_TEMPTABLE_LEN < 256 && HEATER_1_TEMPTABLE_LEN < 256
228
+  && HEATER_2_TEMPTABLE_LEN < 256 && HEATER_3_TEMPTABLE_LEN < 256
229
+  && HEATER_4_TEMPTABLE_LEN < 256 && HEATER_5_TEMPTABLE_LEN < 256
230
+  &&      BED_TEMPTABLE_LEN < 256 &&  CHAMBER_TEMPTABLE_LEN < 256,
224 231
   "Temperature conversion tables over 255 entries need special consideration."
225 232
 );
226 233
 

Loading…
Cancel
Save