Skip to content

Commit

Permalink
🐛 Fix dummy thermistors 998-999 (MarlinFirmware#25956)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellensp authored and Andy-Big committed Jul 19, 2023
1 parent 53f9624 commit 6d082af
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
58 changes: 29 additions & 29 deletions Marlin/src/inc/Conditionals_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -364,12 +364,12 @@
#define TEMP_SENSOR_0_IS_AD8495 1
#elif TEMP_SENSOR_0 == -1
#define TEMP_SENSOR_0_IS_AD595 1
#elif TEMP_SENSOR_0 == 998 || TEMP_SENSOR_0 == 999
#define TEMP_SENSOR_0_IS_DUMMY 1
#elif TEMP_SENSOR_0 > 0
#define TEMP_SENSOR_0_IS_THERMISTOR 1
#if TEMP_SENSOR_0 == 1000
#define TEMP_SENSOR_0_IS_CUSTOM 1
#elif TEMP_SENSOR_0 == 998 || TEMP_SENSOR_0 == 999
#define TEMP_SENSOR_0_IS_DUMMY 1
#endif
#endif

Expand Down Expand Up @@ -407,12 +407,12 @@
#define TEMP_SENSOR_1_IS_AD8495 1
#elif TEMP_SENSOR_1 == -1
#define TEMP_SENSOR_1_IS_AD595 1
#elif TEMP_SENSOR_1 == 998 || TEMP_SENSOR_1 == 999
#define TEMP_SENSOR_1_IS_DUMMY 1
#elif TEMP_SENSOR_1 > 0
#define TEMP_SENSOR_1_IS_THERMISTOR 1
#if TEMP_SENSOR_1 == 1000
#define TEMP_SENSOR_1_IS_CUSTOM 1
#elif TEMP_SENSOR_1 == 998 || TEMP_SENSOR_1 == 999
#define TEMP_SENSOR_1_IS_DUMMY 1
#endif
#endif

Expand Down Expand Up @@ -450,57 +450,57 @@
#define TEMP_SENSOR_2_IS_AD8495 1
#elif TEMP_SENSOR_2 == -1
#define TEMP_SENSOR_2_IS_AD595 1
#elif TEMP_SENSOR_2 == 998 || TEMP_SENSOR_2 == 999
#define TEMP_SENSOR_2_IS_DUMMY 1
#elif TEMP_SENSOR_2 > 0
#define TEMP_SENSOR_2_IS_THERMISTOR 1
#if TEMP_SENSOR_2 == 1000
#define TEMP_SENSOR_2_IS_CUSTOM 1
#elif TEMP_SENSOR_2 == 998 || TEMP_SENSOR_2 == 999
#define TEMP_SENSOR_2_IS_DUMMY 1
#endif
#endif

#if TEMP_SENSOR_3 == 998 || TEMP_SENSOR_3 == 999
#define TEMP_SENSOR_3_IS_DUMMY 1
#elif TEMP_SENSOR_3 > 0
#if TEMP_SENSOR_3 > 0
#define TEMP_SENSOR_3_IS_THERMISTOR 1
#if TEMP_SENSOR_3 == 1000
#define TEMP_SENSOR_3_IS_CUSTOM 1
#elif TEMP_SENSOR_3 == 998 || TEMP_SENSOR_3 == 999
#define TEMP_SENSOR_3_IS_DUMMY 1
#endif
#endif

#if TEMP_SENSOR_4 == 998 || TEMP_SENSOR_4 == 999
#define TEMP_SENSOR_4_IS_DUMMY 1
#elif TEMP_SENSOR_4 > 0
#if TEMP_SENSOR_4 > 0
#define TEMP_SENSOR_4_IS_THERMISTOR 1
#if TEMP_SENSOR_4 == 1000
#define TEMP_SENSOR_4_IS_CUSTOM 1
#elif TEMP_SENSOR_4 == 998 || TEMP_SENSOR_4 == 999
#define TEMP_SENSOR_4_IS_DUMMY 1
#endif
#endif

#if TEMP_SENSOR_5 == 998 || TEMP_SENSOR_5 == 999
#define TEMP_SENSOR_5_IS_DUMMY 1
#elif TEMP_SENSOR_5 > 0
#if TEMP_SENSOR_5 > 0
#define TEMP_SENSOR_5_IS_THERMISTOR 1
#if TEMP_SENSOR_5 == 1000
#define TEMP_SENSOR_5_IS_CUSTOM 1
#elif TEMP_SENSOR_5 == 998 || TEMP_SENSOR_5 == 999
#define TEMP_SENSOR_5_IS_DUMMY 1
#endif
#endif

#if TEMP_SENSOR_6 == 998 || TEMP_SENSOR_6 == 999
#define TEMP_SENSOR_6_IS_DUMMY 1
#elif TEMP_SENSOR_6 > 0
#if TEMP_SENSOR_6 > 0
#define TEMP_SENSOR_6_IS_THERMISTOR 1
#if TEMP_SENSOR_6 == 1000
#define TEMP_SENSOR_6_IS_CUSTOM 1
#elif TEMP_SENSOR_6 == 998 || TEMP_SENSOR_6 == 999
#define TEMP_SENSOR_6_IS_DUMMY 1
#endif
#endif

#if TEMP_SENSOR_7 == 998 || TEMP_SENSOR_7 == 999
#define TEMP_SENSOR_7_IS_DUMMY 1
#elif TEMP_SENSOR_7 > 0
#if TEMP_SENSOR_7 > 0
#define TEMP_SENSOR_7_IS_THERMISTOR 1
#if TEMP_SENSOR_7 == 1000
#define TEMP_SENSOR_7_IS_CUSTOM 1
#elif TEMP_SENSOR_7 == 998 || TEMP_SENSOR_7 == 999
#define TEMP_SENSOR_7_IS_DUMMY 1
#endif
#endif

Expand Down Expand Up @@ -680,12 +680,12 @@
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_BED."
#elif TEMP_SENSOR_BED == -1
#define TEMP_SENSOR_BED_IS_AD595 1
#elif TEMP_SENSOR_BED == 998 || TEMP_SENSOR_BED == 999
#define TEMP_SENSOR_BED_IS_DUMMY 1
#elif TEMP_SENSOR_BED > 0
#define TEMP_SENSOR_BED_IS_THERMISTOR 1
#if TEMP_SENSOR_BED == 1000
#define TEMP_SENSOR_BED_IS_CUSTOM 1
#elif TEMP_SENSOR_BED == 998 || TEMP_SENSOR_BED == 999
#define TEMP_SENSOR_BED_IS_DUMMY 1
#endif
#else
#undef BED_MINTEMP
Expand All @@ -700,12 +700,12 @@
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_CHAMBER."
#elif TEMP_SENSOR_CHAMBER == -1
#define TEMP_SENSOR_CHAMBER_IS_AD595 1
#elif TEMP_SENSOR_CHAMBER == 998 || TEMP_SENSOR_CHAMBER == 999
#define TEMP_SENSOR_CHAMBER_IS_DUMMY 1
#elif TEMP_SENSOR_CHAMBER > 0
#define TEMP_SENSOR_CHAMBER_IS_THERMISTOR 1
#if TEMP_SENSOR_CHAMBER == 1000
#define TEMP_SENSOR_CHAMBER_IS_CUSTOM 1
#elif TEMP_SENSOR_CHAMBER == 998 || TEMP_SENSOR_CHAMBER == 999
#define TEMP_SENSOR_CHAMBER_IS_DUMMY 1
#endif
#else
#undef THERMAL_PROTECTION_CHAMBER
Expand Down Expand Up @@ -742,12 +742,12 @@
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_PROBE."
#elif TEMP_SENSOR_PROBE == -1
#define TEMP_SENSOR_PROBE_IS_AD595 1
#elif TEMP_SENSOR_PROBE == 998 || TEMP_SENSOR_PROBE == 999
#define TEMP_SENSOR_PROBE_IS_DUMMY 1
#elif TEMP_SENSOR_PROBE > 0
#define TEMP_SENSOR_PROBE_IS_THERMISTOR 1
#if TEMP_SENSOR_PROBE == 1000
#define TEMP_SENSOR_PROBE_IS_CUSTOM 1
#elif TEMP_SENSOR_PROBE == 998 || TEMP_SENSOR_PROBE == 999
#define TEMP_SENSOR_PROBE_IS_DUMMY 1
#endif
#endif

Expand All @@ -759,12 +759,12 @@
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_BOARD."
#elif TEMP_SENSOR_BOARD == -1
#define TEMP_SENSOR_BOARD_IS_AD595 1
#elif TEMP_SENSOR_BOARD == 998 || TEMP_SENSOR_BOARD == 999
#define TEMP_SENSOR_BOARD_IS_DUMMY 1
#elif TEMP_SENSOR_BOARD > 0
#define TEMP_SENSOR_BOARD_IS_THERMISTOR 1
#if TEMP_SENSOR_BOARD == 1000
#define TEMP_SENSOR_BOARD_IS_CUSTOM 1
#elif TEMP_SENSOR_BOARD == 998 || TEMP_SENSOR_BOARD == 999
#define TEMP_SENSOR_BOARD_IS_DUMMY 1
#endif
#endif

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/module/temperature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2957,7 +2957,7 @@ void Temperature::init() {
temp_range[NR].raw_max -= TEMPDIR(NR) * (OVERSAMPLENR); \
}while(0)

#define _MINMAX_TEST(N,M) (HOTENDS > N && TEMP_SENSOR_##N##_IS_THERMISTOR && defined(HEATER_##N##_##M##TEMP))
#define _MINMAX_TEST(N,M) (!TEMP_SENSOR_##N##_IS_DUMMY && HOTENDS > N && TEMP_SENSOR_##N##_IS_THERMISTOR && defined(HEATER_##N##_##M##TEMP))

#if _MINMAX_TEST(0, MIN)
_TEMP_MIN_E(0);
Expand Down

0 comments on commit 6d082af

Please sign in to comment.