Fix thermistor table warning
This commit is contained in:
parent
90121047d9
commit
605ec0a478
2 changed files with 16 additions and 9 deletions
|
@ -1431,7 +1431,7 @@ float Temperature::analog_to_celsius_hotend(const int raw, const uint8_t e) {
|
||||||
#if ENABLED(BED_USER_THERMISTOR)
|
#if ENABLED(BED_USER_THERMISTOR)
|
||||||
return user_thermistor_to_deg_c(CTI_BED, raw);
|
return user_thermistor_to_deg_c(CTI_BED, raw);
|
||||||
#elif ENABLED(HEATER_BED_USES_THERMISTOR)
|
#elif ENABLED(HEATER_BED_USES_THERMISTOR)
|
||||||
SCAN_THERMISTOR_TABLE(BEDTEMPTABLE, BEDTEMPTABLE_LEN);
|
SCAN_THERMISTOR_TABLE(BED_TEMPTABLE, BED_TEMPTABLE_LEN);
|
||||||
#elif ENABLED(HEATER_BED_USES_AD595)
|
#elif ENABLED(HEATER_BED_USES_AD595)
|
||||||
return TEMP_AD595(raw);
|
return TEMP_AD595(raw);
|
||||||
#elif ENABLED(HEATER_BED_USES_AD8495)
|
#elif ENABLED(HEATER_BED_USES_AD8495)
|
||||||
|
@ -1449,7 +1449,7 @@ float Temperature::analog_to_celsius_hotend(const int raw, const uint8_t e) {
|
||||||
#if ENABLED(CHAMBER_USER_THERMISTOR)
|
#if ENABLED(CHAMBER_USER_THERMISTOR)
|
||||||
return user_thermistor_to_deg_c(CTI_CHAMBER, raw);
|
return user_thermistor_to_deg_c(CTI_CHAMBER, raw);
|
||||||
#elif ENABLED(HEATER_CHAMBER_USES_THERMISTOR)
|
#elif ENABLED(HEATER_CHAMBER_USES_THERMISTOR)
|
||||||
SCAN_THERMISTOR_TABLE(CHAMBERTEMPTABLE, CHAMBERTEMPTABLE_LEN);
|
SCAN_THERMISTOR_TABLE(CHAMBER_TEMPTABLE, CHAMBER_TEMPTABLE_LEN);
|
||||||
#elif ENABLED(HEATER_CHAMBER_USES_AD595)
|
#elif ENABLED(HEATER_CHAMBER_USES_AD595)
|
||||||
return TEMP_AD595(raw);
|
return TEMP_AD595(raw);
|
||||||
#elif ENABLED(HEATER_CHAMBER_USES_AD8495)
|
#elif ENABLED(HEATER_CHAMBER_USES_AD8495)
|
||||||
|
|
|
@ -137,6 +137,9 @@
|
||||||
#if ANY_THERMISTOR_IS(999) // User-defined table 2
|
#if ANY_THERMISTOR_IS(999) // User-defined table 2
|
||||||
#include "thermistor_999.h"
|
#include "thermistor_999.h"
|
||||||
#endif
|
#endif
|
||||||
|
#if ANY_THERMISTOR_IS(1000) // Custom
|
||||||
|
const short temptable_1000[][2] PROGMEM = { { 0, 0 } };
|
||||||
|
#endif
|
||||||
|
|
||||||
#define _TT_NAME(_N) temptable_ ## _N
|
#define _TT_NAME(_N) temptable_ ## _N
|
||||||
#define TT_NAME(_N) _TT_NAME(_N)
|
#define TT_NAME(_N) _TT_NAME(_N)
|
||||||
|
@ -202,25 +205,29 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef THERMISTORBED
|
#ifdef THERMISTORBED
|
||||||
#define BEDTEMPTABLE TT_NAME(THERMISTORBED)
|
#define BED_TEMPTABLE TT_NAME(THERMISTORBED)
|
||||||
#define BEDTEMPTABLE_LEN COUNT(BEDTEMPTABLE)
|
#define BED_TEMPTABLE_LEN COUNT(BED_TEMPTABLE)
|
||||||
#elif defined(HEATER_BED_USES_THERMISTOR)
|
#elif defined(HEATER_BED_USES_THERMISTOR)
|
||||||
#error "No bed thermistor table specified"
|
#error "No bed thermistor table specified"
|
||||||
#else
|
#else
|
||||||
#define BEDTEMPTABLE_LEN 0
|
#define BED_TEMPTABLE_LEN 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef THERMISTORCHAMBER
|
#ifdef THERMISTORCHAMBER
|
||||||
#define CHAMBERTEMPTABLE TT_NAME(THERMISTORCHAMBER)
|
#define CHAMBER_TEMPTABLE TT_NAME(THERMISTORCHAMBER)
|
||||||
#define CHAMBERTEMPTABLE_LEN COUNT(CHAMBERTEMPTABLE)
|
#define CHAMBER_TEMPTABLE_LEN COUNT(CHAMBER_TEMPTABLE)
|
||||||
#elif defined(HEATER_CHAMBER_USES_THERMISTOR)
|
#elif defined(HEATER_CHAMBER_USES_THERMISTOR)
|
||||||
#error "No chamber thermistor table specified"
|
#error "No chamber thermistor table specified"
|
||||||
#else
|
#else
|
||||||
#define CHAMBERTEMPTABLE_LEN 0
|
#define CHAMBER_TEMPTABLE_LEN 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// The SCAN_THERMISTOR_TABLE macro needs alteration?
|
// The SCAN_THERMISTOR_TABLE macro needs alteration?
|
||||||
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,
|
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 && HEATER_5_TEMPTABLE_LEN < 256
|
||||||
|
&& BED_TEMPTABLE_LEN < 256 && CHAMBER_TEMPTABLE_LEN < 256,
|
||||||
"Temperature conversion tables over 255 entries need special consideration."
|
"Temperature conversion tables over 255 entries need special consideration."
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Reference in a new issue