Allow dummy thermistors without pin definitions (#20159)

This commit is contained in:
Jason Smith 2020-11-16 12:56:59 -08:00 committed by Scott Lahteine
parent daa2a04fc9
commit a01fab662c
2 changed files with 32 additions and 10 deletions

View file

@ -458,6 +458,8 @@
#define HEATER_0_USES_THERMISTOR 1 #define HEATER_0_USES_THERMISTOR 1
#if TEMP_SENSOR_0 == 1000 #if TEMP_SENSOR_0 == 1000
#define HEATER_0_USER_THERMISTOR 1 #define HEATER_0_USER_THERMISTOR 1
#elif TEMP_SENSOR_0 == 998 || TEMP_SENSOR_0 == 999
#define HEATER_0_DUMMY_THERMISTOR 1
#endif #endif
#else #else
#undef HEATER_0_MINTEMP #undef HEATER_0_MINTEMP
@ -496,6 +498,8 @@
#define HEATER_1_USES_THERMISTOR 1 #define HEATER_1_USES_THERMISTOR 1
#if TEMP_SENSOR_1 == 1000 #if TEMP_SENSOR_1 == 1000
#define HEATER_1_USER_THERMISTOR 1 #define HEATER_1_USER_THERMISTOR 1
#elif TEMP_SENSOR_1 == 998 || TEMP_SENSOR_1 == 999
#define HEATER_1_DUMMY_THERMISTOR 1
#endif #endif
#else #else
#undef HEATER_1_MINTEMP #undef HEATER_1_MINTEMP
@ -515,6 +519,8 @@
#define HEATER_2_USES_THERMISTOR 1 #define HEATER_2_USES_THERMISTOR 1
#if TEMP_SENSOR_2 == 1000 #if TEMP_SENSOR_2 == 1000
#define HEATER_2_USER_THERMISTOR 1 #define HEATER_2_USER_THERMISTOR 1
#elif TEMP_SENSOR_2 == 998 || TEMP_SENSOR_2 == 999
#define HEATER_2_DUMMY_THERMISTOR 1
#endif #endif
#else #else
#undef HEATER_2_MINTEMP #undef HEATER_2_MINTEMP
@ -534,6 +540,8 @@
#define HEATER_3_USES_THERMISTOR 1 #define HEATER_3_USES_THERMISTOR 1
#if TEMP_SENSOR_3 == 1000 #if TEMP_SENSOR_3 == 1000
#define HEATER_3_USER_THERMISTOR 1 #define HEATER_3_USER_THERMISTOR 1
#elif TEMP_SENSOR_3 == 998 || TEMP_SENSOR_3 == 999
#define HEATER_3_DUMMY_THERMISTOR 1
#endif #endif
#else #else
#undef HEATER_3_MINTEMP #undef HEATER_3_MINTEMP
@ -553,6 +561,8 @@
#define HEATER_4_USES_THERMISTOR 1 #define HEATER_4_USES_THERMISTOR 1
#if TEMP_SENSOR_4 == 1000 #if TEMP_SENSOR_4 == 1000
#define HEATER_4_USER_THERMISTOR 1 #define HEATER_4_USER_THERMISTOR 1
#elif TEMP_SENSOR_4 == 998 || TEMP_SENSOR_4 == 999
#define HEATER_4_DUMMY_THERMISTOR 1
#endif #endif
#else #else
#undef HEATER_4_MINTEMP #undef HEATER_4_MINTEMP
@ -572,6 +582,8 @@
#define HEATER_5_USES_THERMISTOR 1 #define HEATER_5_USES_THERMISTOR 1
#if TEMP_SENSOR_5 == 1000 #if TEMP_SENSOR_5 == 1000
#define HEATER_5_USER_THERMISTOR 1 #define HEATER_5_USER_THERMISTOR 1
#elif TEMP_SENSOR_5 == 998 || TEMP_SENSOR_5 == 999
#define HEATER_5_DUMMY_THERMISTOR 1
#endif #endif
#else #else
#undef HEATER_5_MINTEMP #undef HEATER_5_MINTEMP
@ -591,6 +603,8 @@
#define HEATER_6_USES_THERMISTOR 1 #define HEATER_6_USES_THERMISTOR 1
#if TEMP_SENSOR_6 == 1000 #if TEMP_SENSOR_6 == 1000
#define HEATER_6_USER_THERMISTOR 1 #define HEATER_6_USER_THERMISTOR 1
#elif TEMP_SENSOR_6 == 998 || TEMP_SENSOR_6 == 999
#define HEATER_6_DUMMY_THERMISTOR 1
#endif #endif
#else #else
#undef HEATER_6_MINTEMP #undef HEATER_6_MINTEMP
@ -610,6 +624,8 @@
#define HEATER_7_USES_THERMISTOR 1 #define HEATER_7_USES_THERMISTOR 1
#if TEMP_SENSOR_7 == 1000 #if TEMP_SENSOR_7 == 1000
#define HEATER_7_USER_THERMISTOR 1 #define HEATER_7_USER_THERMISTOR 1
#elif TEMP_SENSOR_7 == 998 || TEMP_SENSOR_7 == 999
#define HEATER_7_DUMMY_THERMISTOR 1
#endif #endif
#else #else
#undef HEATER_7_MINTEMP #undef HEATER_7_MINTEMP
@ -629,6 +645,8 @@
#define HEATER_BED_USES_THERMISTOR 1 #define HEATER_BED_USES_THERMISTOR 1
#if TEMP_SENSOR_BED == 1000 #if TEMP_SENSOR_BED == 1000
#define HEATER_BED_USER_THERMISTOR 1 #define HEATER_BED_USER_THERMISTOR 1
#elif TEMP_SENSOR_BED == 998 || TEMP_SENSOR_BED == 999
#define HEATER_BED_DUMMY_THERMISTOR 1
#endif #endif
#else #else
#undef BED_MINTEMP #undef BED_MINTEMP
@ -648,6 +666,8 @@
#define HEATER_CHAMBER_USES_THERMISTOR 1 #define HEATER_CHAMBER_USES_THERMISTOR 1
#if TEMP_SENSOR_CHAMBER == 1000 #if TEMP_SENSOR_CHAMBER == 1000
#define HEATER_CHAMBER_USER_THERMISTOR 1 #define HEATER_CHAMBER_USER_THERMISTOR 1
#elif TEMP_SENSOR_CHAMBER == 998 || TEMP_SENSOR_CHAMBER == 999
#define HEATER_CHAMBER_DUMMY_THERMISTOR 1
#endif #endif
#else #else
#undef CHAMBER_MINTEMP #undef CHAMBER_MINTEMP
@ -667,6 +687,8 @@
#define HEATER_PROBE_USES_THERMISTOR 1 #define HEATER_PROBE_USES_THERMISTOR 1
#if TEMP_SENSOR_PROBE == 1000 #if TEMP_SENSOR_PROBE == 1000
#define HEATER_PROBE_USER_THERMISTOR 1 #define HEATER_PROBE_USER_THERMISTOR 1
#elif TEMP_SENSOR_PROBE == 998 || TEMP_SENSOR_PROBE == 999
#define HEATER_PROBE_DUMMY_THERMISTOR 1
#endif #endif
#endif #endif
@ -1754,7 +1776,7 @@
// //
// ADC Temp Sensors (Thermistor or Thermocouple with amplifier ADC interface) // ADC Temp Sensors (Thermistor or Thermocouple with amplifier ADC interface)
// //
#define HAS_ADC_TEST(P) (PIN_EXISTS(TEMP_##P) && TEMP_SENSOR_##P != 0 && DISABLED(HEATER_##P##_USES_MAX6675)) #define HAS_ADC_TEST(P) (PIN_EXISTS(TEMP_##P) && TEMP_SENSOR_##P != 0 && NONE(HEATER_##P##_USES_MAX6675, HEATER_##P##_DUMMY_THERMISTOR))
#if HAS_ADC_TEST(0) #if HAS_ADC_TEST(0)
#define HAS_TEMP_ADC_0 1 #define HAS_TEMP_ADC_0 1
#endif #endif
@ -1789,7 +1811,7 @@
#define HAS_TEMP_ADC_CHAMBER 1 #define HAS_TEMP_ADC_CHAMBER 1
#endif #endif
#if HAS_HOTEND && EITHER(HAS_TEMP_ADC_0, HEATER_0_USES_MAX6675) #if HAS_HOTEND && ANY(HAS_TEMP_ADC_0, HEATER_0_USES_MAX6675, HEATER_0_DUMMY_THERMISTOR)
#define HAS_TEMP_HOTEND 1 #define HAS_TEMP_HOTEND 1
#endif #endif
#define HAS_TEMP_BED HAS_TEMP_ADC_BED #define HAS_TEMP_BED HAS_TEMP_ADC_BED

View file

@ -1638,7 +1638,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
*/ */
#if HEATER_0_USES_MAX6675 && !PIN_EXISTS(MAX6675_SS) #if HEATER_0_USES_MAX6675 && !PIN_EXISTS(MAX6675_SS)
#error "MAX6675_SS_PIN (required for TEMP_SENSOR_0) not defined for this board." #error "MAX6675_SS_PIN (required for TEMP_SENSOR_0) not defined for this board."
#elif HAS_HOTEND && !HAS_TEMP_HOTEND #elif HAS_HOTEND && !HAS_TEMP_HOTEND && !HEATER_0_DUMMY_THERMISTOR
#error "TEMP_0_PIN (required for TEMP_SENSOR_0) not defined for this board." #error "TEMP_0_PIN (required for TEMP_SENSOR_0) not defined for this board."
#elif EITHER(HAS_MULTI_HOTEND, HEATERS_PARALLEL) && !HAS_HEATER_1 #elif EITHER(HAS_MULTI_HOTEND, HEATERS_PARALLEL) && !HAS_HEATER_1
#error "HEATER_1_PIN is not defined. TEMP_SENSOR_1 might not be set, or the board (not EEB / EEF?) doesn't define a pin." #error "HEATER_1_PIN is not defined. TEMP_SENSOR_1 might not be set, or the board (not EEB / EEF?) doesn't define a pin."
@ -1649,7 +1649,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
#error "MAX6675_SS2_PIN (required for TEMP_SENSOR_1) not defined for this board." #error "MAX6675_SS2_PIN (required for TEMP_SENSOR_1) not defined for this board."
#elif TEMP_SENSOR_1 == 0 #elif TEMP_SENSOR_1 == 0
#error "TEMP_SENSOR_1 is required with 2 or more HOTENDS." #error "TEMP_SENSOR_1 is required with 2 or more HOTENDS."
#elif !ANY_PIN(TEMP_1, MAX6675_SS2) #elif !ANY_PIN(TEMP_1, MAX6675_SS2) && !HEATER_1_DUMMY_THERMISTOR
#error "TEMP_1_PIN not defined for this board." #error "TEMP_1_PIN not defined for this board."
#elif ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) #elif ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
#error "HOTENDS must be 1 with TEMP_SENSOR_1_AS_REDUNDANT." #error "HOTENDS must be 1 with TEMP_SENSOR_1_AS_REDUNDANT."
@ -1659,7 +1659,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
#error "TEMP_SENSOR_2 is required with 3 or more HOTENDS." #error "TEMP_SENSOR_2 is required with 3 or more HOTENDS."
#elif !HAS_HEATER_2 #elif !HAS_HEATER_2
#error "HEATER_2_PIN not defined for this board." #error "HEATER_2_PIN not defined for this board."
#elif !PIN_EXISTS(TEMP_2) #elif !PIN_EXISTS(TEMP_2) && !HEATER_2_DUMMY_THERMISTOR
#error "TEMP_2_PIN not defined for this board." #error "TEMP_2_PIN not defined for this board."
#endif #endif
#if HOTENDS > 3 #if HOTENDS > 3
@ -1667,7 +1667,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
#error "TEMP_SENSOR_3 is required with 4 or more HOTENDS." #error "TEMP_SENSOR_3 is required with 4 or more HOTENDS."
#elif !HAS_HEATER_3 #elif !HAS_HEATER_3
#error "HEATER_3_PIN not defined for this board." #error "HEATER_3_PIN not defined for this board."
#elif !PIN_EXISTS(TEMP_3) #elif !PIN_EXISTS(TEMP_3) && !HEATER_3_DUMMY_THERMISTOR
#error "TEMP_3_PIN not defined for this board." #error "TEMP_3_PIN not defined for this board."
#endif #endif
#if HOTENDS > 4 #if HOTENDS > 4
@ -1675,7 +1675,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
#error "TEMP_SENSOR_4 is required with 5 or more HOTENDS." #error "TEMP_SENSOR_4 is required with 5 or more HOTENDS."
#elif !HAS_HEATER_4 #elif !HAS_HEATER_4
#error "HEATER_4_PIN not defined for this board." #error "HEATER_4_PIN not defined for this board."
#elif !PIN_EXISTS(TEMP_4) #elif !PIN_EXISTS(TEMP_4) && !HEATER_4_DUMMY_THERMISTOR
#error "TEMP_4_PIN not defined for this board." #error "TEMP_4_PIN not defined for this board."
#endif #endif
#if HOTENDS > 5 #if HOTENDS > 5
@ -1683,7 +1683,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
#error "TEMP_SENSOR_5 is required with 6 HOTENDS." #error "TEMP_SENSOR_5 is required with 6 HOTENDS."
#elif !HAS_HEATER_5 #elif !HAS_HEATER_5
#error "HEATER_5_PIN not defined for this board." #error "HEATER_5_PIN not defined for this board."
#elif !PIN_EXISTS(TEMP_5) #elif !PIN_EXISTS(TEMP_5) && !HEATER_5_DUMMY_THERMISTOR
#error "TEMP_5_PIN not defined for this board." #error "TEMP_5_PIN not defined for this board."
#endif #endif
#if HOTENDS > 6 #if HOTENDS > 6
@ -1691,7 +1691,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
#error "TEMP_SENSOR_6 is required with 6 HOTENDS." #error "TEMP_SENSOR_6 is required with 6 HOTENDS."
#elif !HAS_HEATER_6 #elif !HAS_HEATER_6
#error "HEATER_6_PIN not defined for this board." #error "HEATER_6_PIN not defined for this board."
#elif !PIN_EXISTS(TEMP_6) #elif !PIN_EXISTS(TEMP_6) && !HEATER_6_DUMMY_THERMISTOR
#error "TEMP_6_PIN not defined for this board." #error "TEMP_6_PIN not defined for this board."
#endif #endif
#if HOTENDS > 7 #if HOTENDS > 7
@ -1699,7 +1699,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
#error "TEMP_SENSOR_7 is required with 7 HOTENDS." #error "TEMP_SENSOR_7 is required with 7 HOTENDS."
#elif !HAS_HEATER_7 #elif !HAS_HEATER_7
#error "HEATER_7_PIN not defined for this board." #error "HEATER_7_PIN not defined for this board."
#elif !PIN_EXISTS(TEMP_7) #elif !PIN_EXISTS(TEMP_7) && !HEATER_7_DUMMY_THERMISTOR
#error "TEMP_7_PIN not defined for this board." #error "TEMP_7_PIN not defined for this board."
#endif #endif
#elif TEMP_SENSOR_7 != 0 #elif TEMP_SENSOR_7 != 0