1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-23 12:04:19 +00:00

Warn about dummy thermistors

This commit is contained in:
Scott Lahteine 2021-10-18 01:49:35 -05:00
parent b93c3301f2
commit ad4a8a68c2
5 changed files with 25 additions and 92 deletions

View File

@ -132,17 +132,15 @@
#define HID_E6 6 #define HID_E6 6
#define HID_E7 7 #define HID_E7 7
#define ANY_TEMP_SENSOR_IS(n) (n == TEMP_SENSOR_0 || n == TEMP_SENSOR_1 || n == TEMP_SENSOR_2 || n == TEMP_SENSOR_3 \ #define _SENSOR_IS(I,N) || (TEMP_SENSOR_##N == I)
|| n == TEMP_SENSOR_4 || n == TEMP_SENSOR_5 || n == TEMP_SENSOR_6 || n == TEMP_SENSOR_7 \ #define _E_SENSOR_IS(I,N) _SENSOR_IS(N,I)
|| n == TEMP_SENSOR_BED \ #define ANY_THERMISTOR_IS(N) (0 REPEAT2(HOTENDS, _E_SENSOR_IS, N) \
|| n == TEMP_SENSOR_PROBE \ _SENSOR_IS(N,BED) _SENSOR_IS(N,PROBE) _SENSOR_IS(N,CHAMBER) \
|| n == TEMP_SENSOR_CHAMBER \ _SENSOR_IS(N,COOLER) _SENSOR_IS(N,BOARD) _SENSOR_IS(N,REDUNDANT) )
|| n == TEMP_SENSOR_COOLER \
|| n == TEMP_SENSOR_REDUNDANT ) #if ANY_THERMISTOR_IS(1000)
#if ANY_TEMP_SENSOR_IS(1000)
#define HAS_USER_THERMISTORS 1 #define HAS_USER_THERMISTORS 1
#endif #endif
#undef ANY_TEMP_SENSOR_IS
#if TEMP_SENSOR_REDUNDANT #if TEMP_SENSOR_REDUNDANT
#define _HEATER_ID(M) HID_##M #define _HEATER_ID(M) HID_##M

View File

@ -2193,68 +2193,12 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#elif !PIN_EXISTS(TEMP_7) && !TEMP_SENSOR_7_IS_DUMMY #elif !PIN_EXISTS(TEMP_7) && !TEMP_SENSOR_7_IS_DUMMY
#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 #endif // HOTENDS > 7
#error "TEMP_SENSOR_7 shouldn't be set with only 7 HOTENDS." #endif // HOTENDS > 6
#endif #endif // HOTENDS > 5
#elif TEMP_SENSOR_6 != 0 #endif // HOTENDS > 4
#error "TEMP_SENSOR_6 shouldn't be set with only 6 HOTENDS." #endif // HOTENDS > 3
#elif TEMP_SENSOR_7 != 0 #endif // HOTENDS > 2
#error "TEMP_SENSOR_7 shouldn't be set with only 6 HOTENDS."
#endif
#elif TEMP_SENSOR_5 != 0
#error "TEMP_SENSOR_5 shouldn't be set with only 5 HOTENDS."
#elif TEMP_SENSOR_6 != 0
#error "TEMP_SENSOR_6 shouldn't be set with only 5 HOTENDS."
#elif TEMP_SENSOR_7 != 0
#error "TEMP_SENSOR_7 shouldn't be set with only 5 HOTENDS."
#endif
#elif TEMP_SENSOR_4 != 0
#error "TEMP_SENSOR_4 shouldn't be set with only 4 HOTENDS."
#elif TEMP_SENSOR_5 != 0
#error "TEMP_SENSOR_5 shouldn't be set with only 4 HOTENDS."
#elif TEMP_SENSOR_6 != 0
#error "TEMP_SENSOR_6 shouldn't be set with only 4 HOTENDS."
#elif TEMP_SENSOR_7 != 0
#error "TEMP_SENSOR_7 shouldn't be set with only 4 HOTENDS."
#endif
#elif TEMP_SENSOR_3 != 0
#error "TEMP_SENSOR_3 shouldn't be set with only 3 HOTENDS."
#elif TEMP_SENSOR_4 != 0
#error "TEMP_SENSOR_4 shouldn't be set with only 3 HOTENDS."
#elif TEMP_SENSOR_5 != 0
#error "TEMP_SENSOR_5 shouldn't be set with only 3 HOTENDS."
#elif TEMP_SENSOR_6 != 0
#error "TEMP_SENSOR_6 shouldn't be set with only 3 HOTENDS."
#elif TEMP_SENSOR_7 != 0
#error "TEMP_SENSOR_7 shouldn't be set with only 3 HOTENDS."
#endif
#elif TEMP_SENSOR_2 != 0
#error "TEMP_SENSOR_2 shouldn't be set with only 2 HOTENDS."
#elif TEMP_SENSOR_3 != 0
#error "TEMP_SENSOR_3 shouldn't be set with only 2 HOTENDS."
#elif TEMP_SENSOR_4 != 0
#error "TEMP_SENSOR_4 shouldn't be set with only 2 HOTENDS."
#elif TEMP_SENSOR_5 != 0
#error "TEMP_SENSOR_5 shouldn't be set with only 2 HOTENDS."
#elif TEMP_SENSOR_6 != 0
#error "TEMP_SENSOR_6 shouldn't be set with only 2 HOTENDS."
#elif TEMP_SENSOR_7 != 0
#error "TEMP_SENSOR_7 shouldn't be set with only 2 HOTENDS."
#endif
#elif TEMP_SENSOR_1 != 0
#error "TEMP_SENSOR_1 shouldn't be set with only 1 HOTEND."
#elif TEMP_SENSOR_2 != 0
#error "TEMP_SENSOR_2 shouldn't be set with only 1 HOTEND."
#elif TEMP_SENSOR_3 != 0
#error "TEMP_SENSOR_3 shouldn't be set with only 1 HOTEND."
#elif TEMP_SENSOR_4 != 0
#error "TEMP_SENSOR_4 shouldn't be set with only 1 HOTEND."
#elif TEMP_SENSOR_5 != 0
#error "TEMP_SENSOR_5 shouldn't be set with only 1 HOTEND."
#elif TEMP_SENSOR_6 != 0
#error "TEMP_SENSOR_6 shouldn't be set with only 1 HOTEND."
#elif TEMP_SENSOR_7 != 0
#error "TEMP_SENSOR_7 shouldn't be set with only 1 HOTEND."
#endif // HAS_MULTI_HOTEND #endif // HAS_MULTI_HOTEND
/** /**
@ -3292,7 +3236,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#if HAS_MOTOR_CURRENT_I2C #if HAS_MOTOR_CURRENT_I2C
#if BOTH(DIGIPOT_MCP4018, DIGIPOT_MCP4451) #if BOTH(DIGIPOT_MCP4018, DIGIPOT_MCP4451)
#error "Enable only one of DIGIPOT_MCP4018 or DIGIPOT_MCP4451." #error "Enable only one of DIGIPOT_MCP4018 or DIGIPOT_MCP4451."
#elif !MB(MKS_SBASE, AZTEEG_X5_GT, AZTEEG_X5_MINI, AZTEEG_X5_MINI_WIFI) \ #elif !MB(MKS_SBASE, AZTEEG_X5_GT, AZTEEG_X5_MINI, AZTEEG_X5_MINI_WIFI) \
&& (!defined(DIGIPOTS_I2C_SDA_X) || !defined(DIGIPOTS_I2C_SDA_Y) || !defined(DIGIPOTS_I2C_SDA_Z) || !defined(DIGIPOTS_I2C_SDA_E0) || !defined(DIGIPOTS_I2C_SDA_E1)) && (!defined(DIGIPOTS_I2C_SDA_X) || !defined(DIGIPOTS_I2C_SDA_Y) || !defined(DIGIPOTS_I2C_SDA_Z) || !defined(DIGIPOTS_I2C_SDA_E0) || !defined(DIGIPOTS_I2C_SDA_E1))
#error "DIGIPOT_MCP4018/4451 requires DIGIPOTS_I2C_SDA_* pins to be defined." #error "DIGIPOT_MCP4018/4451 requires DIGIPOTS_I2C_SDA_* pins to be defined."
#endif #endif

View File

@ -51,6 +51,9 @@
#if HAS_COOLER && DISABLED(THERMAL_PROTECTION_COOLER) #if HAS_COOLER && DISABLED(THERMAL_PROTECTION_COOLER)
#warning "Safety Alert! Enable THERMAL_PROTECTION_COOLER for the final build!" #warning "Safety Alert! Enable THERMAL_PROTECTION_COOLER for the final build!"
#endif #endif
#if ANY_THERMISTOR_IS(998) || ANY_THERMISTOR_IS(999)
#warning "Warning! Don't use dummy thermistors (998/999) for final build!"
#endif
#if NONE(HAS_RESUME_CONTINUE, HOST_PROMPT_SUPPORT) #if NONE(HAS_RESUME_CONTINUE, HOST_PROMPT_SUPPORT)
#warning "Your Configuration provides no method to acquire user feedback!" #warning "Your Configuration provides no method to acquire user feedback!"

View File

@ -2207,22 +2207,22 @@ void Temperature::init() {
// Thermistor activation by MCU pin // Thermistor activation by MCU pin
#if PIN_EXISTS(TEMP_0_TR_ENABLE) #if PIN_EXISTS(TEMP_0_TR_ENABLE)
OUT_WRITE(TEMP_0_TR_ENABLE_PIN, OUT_WRITE(TEMP_0_TR_ENABLE_PIN, (
#if TEMP_SENSOR_IS_ANY_MAX_TC(0) #if TEMP_SENSOR_IS_ANY_MAX_TC(0)
1 HIGH
#else #else
0 LOW
#endif #endif
); ));
#endif #endif
#if PIN_EXISTS(TEMP_1_TR_ENABLE) #if PIN_EXISTS(TEMP_1_TR_ENABLE)
OUT_WRITE(TEMP_1_TR_ENABLE_PIN, OUT_WRITE(TEMP_1_TR_ENABLE_PIN, (
#if TEMP_SENSOR_IS_ANY_MAX_TC(1) #if TEMP_SENSOR_IS_ANY_MAX_TC(1)
1 HIGH
#else #else
0 LOW
#endif #endif
); ));
#endif #endif
#if HAS_HEATER_0 #if HAS_HEATER_0

View File

@ -42,18 +42,6 @@
#define OV_SCALE(N) (N) #define OV_SCALE(N) (N)
#define OV(N) int16_t(OV_SCALE(N) * (OVERSAMPLENR) * (THERMISTOR_TABLE_SCALE)) #define OV(N) int16_t(OV_SCALE(N) * (OVERSAMPLENR) * (THERMISTOR_TABLE_SCALE))
#define TEMP_SENSOR_IS(n,H) (n == TEMP_SENSOR_##H)
#define ANY_THERMISTOR_IS(n) ( TEMP_SENSOR_IS(n, 0) || TEMP_SENSOR_IS(n, 1) \
|| TEMP_SENSOR_IS(n, 2) || TEMP_SENSOR_IS(n, 3) \
|| TEMP_SENSOR_IS(n, 4) || TEMP_SENSOR_IS(n, 5) \
|| TEMP_SENSOR_IS(n, 6) || TEMP_SENSOR_IS(n, 7) \
|| TEMP_SENSOR_IS(n, BED) \
|| TEMP_SENSOR_IS(n, CHAMBER) \
|| TEMP_SENSOR_IS(n, COOLER) \
|| TEMP_SENSOR_IS(n, PROBE) \
|| TEMP_SENSOR_IS(n, BOARD) \
|| TEMP_SENSOR_IS(n, REDUNDANT) )
typedef struct { int16_t value; celsius_t celsius; } temp_entry_t; typedef struct { int16_t value; celsius_t celsius; } temp_entry_t;
// Pt1000 and Pt100 handling // Pt1000 and Pt100 handling