1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-29 23:07:42 +00:00

Long temperature tables need special consideration

This commit is contained in:
Scott Lahteine 2018-05-28 06:26:05 -05:00
parent c45bfc1c21
commit dfe90d552d
2 changed files with 13 additions and 8 deletions

View File

@ -53,10 +53,10 @@
#if HOTEND_USES_THERMISTOR #if HOTEND_USES_THERMISTOR
#if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
static void* heater_ttbl_map[2] = { (void*)HEATER_0_TEMPTABLE, (void*)HEATER_1_TEMPTABLE }; static void* heater_ttbl_map[2] = { (void*)HEATER_0_TEMPTABLE, (void*)HEATER_1_TEMPTABLE };
static uint8_t heater_ttbllen_map[2] = { HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN }; static constexpr uint8_t heater_ttbllen_map[2] = { HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN };
#else #else
static void* heater_ttbl_map[HOTENDS] = ARRAY_BY_HOTENDS((void*)HEATER_0_TEMPTABLE, (void*)HEATER_1_TEMPTABLE, (void*)HEATER_2_TEMPTABLE, (void*)HEATER_3_TEMPTABLE, (void*)HEATER_4_TEMPTABLE); static void* heater_ttbl_map[HOTENDS] = ARRAY_BY_HOTENDS((void*)HEATER_0_TEMPTABLE, (void*)HEATER_1_TEMPTABLE, (void*)HEATER_2_TEMPTABLE, (void*)HEATER_3_TEMPTABLE, (void*)HEATER_4_TEMPTABLE);
static uint8_t heater_ttbllen_map[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN, HEATER_2_TEMPTABLE_LEN, HEATER_3_TEMPTABLE_LEN, HEATER_4_TEMPTABLE_LEN); static constexpr uint8_t heater_ttbllen_map[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN, HEATER_2_TEMPTABLE_LEN, HEATER_3_TEMPTABLE_LEN, HEATER_4_TEMPTABLE_LEN);
#endif #endif
#endif #endif

View File

@ -185,21 +185,26 @@
#ifdef THERMISTORBED #ifdef THERMISTORBED
#define BEDTEMPTABLE TT_NAME(THERMISTORBED) #define BEDTEMPTABLE TT_NAME(THERMISTORBED)
#define BEDTEMPTABLE_LEN COUNT(BEDTEMPTABLE) #define BEDTEMPTABLE_LEN COUNT(BEDTEMPTABLE)
#elif defined(HEATER_BED_USES_THERMISTOR)
#error "No bed thermistor table specified"
#else #else
#ifdef HEATER_BED_USES_THERMISTOR #define BEDTEMPTABLE_LEN 0
#error "No bed thermistor table specified"
#endif
#endif #endif
#ifdef THERMISTORCHAMBER #ifdef THERMISTORCHAMBER
#define CHAMBERTEMPTABLE TT_NAME(THERMISTORCHAMBER) #define CHAMBERTEMPTABLE TT_NAME(THERMISTORCHAMBER)
#define CHAMBERTEMPTABLE_LEN COUNT(CHAMBERTEMPTABLE) #define CHAMBERTEMPTABLE_LEN COUNT(CHAMBERTEMPTABLE)
#elif defined(HEATER_CHAMBER_USES_THERMISTOR)
#error "No chamber thermistor table specified"
#else #else
#ifdef HEATER_CHAMBER_USES_THERMISTOR #define CHAMBERTEMPTABLE_LEN 0
#error "No chamber thermistor table specified"
#endif
#endif #endif
// The SCAN_THERMISTOR_TABLE macro needs alteration?
static_assert(HEATER_0_TEMPTABLE_LEN < 128 && HEATER_1_TEMPTABLE_LEN < 128 && HEATER_2_TEMPTABLE_LEN < 128 && HEATER_3_TEMPTABLE_LEN < 128 && HEATER_4_TEMPTABLE_LEN < 128 && BEDTEMPTABLE_LEN < 128 && CHAMBERTEMPTABLE_LEN < 128,
"Temperature conversion tables over 127 entries need special consideration."
);
// Set the high and low raw values for the heaters // Set the high and low raw values for the heaters
// For thermistors the highest temperature results in the lowest ADC value // For thermistors the highest temperature results in the lowest ADC value
// For thermocouples the highest temperature results in the highest ADC value // For thermocouples the highest temperature results in the highest ADC value