Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes: #18525 trying to read from thermistor when there is none. #18533

Merged
merged 3 commits into from
Jul 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 41 additions & 62 deletions Marlin/src/module/temperature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1804,76 +1804,55 @@ void Temperature::init() {
temp_range[NR].raw_max -= TEMPDIR(NR) * (OVERSAMPLENR); \
}while(0)

#if THERMISTOR_HEATER_0
#ifdef HEATER_0_MINTEMP
#define _MINMAX_TEST(N,M) (HOTENDS > N && THERMISTOR_HEATER_##N && THERMISTOR_HEATER_##N != 998 && THERMISTOR_HEATER_##N != 999 && defined(HEATER_##N##_##M##TEMP))

#if _MINMAX_TEST(0, MIN)
_TEMP_MIN_E(0);
#endif
#ifdef HEATER_0_MAXTEMP
_TEMP_MAX_E(0);
#endif
#endif

#if HAS_MULTI_HOTEND && THERMISTOR_HEATER_1
#ifdef HEATER_1_MINTEMP
_TEMP_MIN_E(1);
#endif
#ifdef HEATER_1_MAXTEMP
_TEMP_MAX_E(1);
#endif
#if _MINMAX_TEST(0, MAX)
_TEMP_MAX_E(0);
#endif

#if HOTENDS > 2 && THERMISTOR_HEATER_2
#ifdef HEATER_2_MINTEMP
_TEMP_MIN_E(2);
#endif
#ifdef HEATER_2_MAXTEMP
_TEMP_MAX_E(2);
#endif
#if _MINMAX_TEST(1, MIN)
_TEMP_MIN_E(1);
#endif

#if HOTENDS > 3 && THERMISTOR_HEATER_3
#ifdef HEATER_3_MINTEMP
_TEMP_MIN_E(3);
#endif
#ifdef HEATER_3_MAXTEMP
_TEMP_MAX_E(3);
#endif
#if _MINMAX_TEST(1, MAX)
_TEMP_MAX_E(1);
#endif

#if HOTENDS > 4 && THERMISTOR_HEATER_4
#ifdef HEATER_4_MINTEMP
_TEMP_MIN_E(4);
#endif
#ifdef HEATER_4_MAXTEMP
_TEMP_MAX_E(4);
#endif
#if _MINMAX_TEST(2, MIN)
_TEMP_MIN_E(2);
#endif

#if HOTENDS > 5 && THERMISTOR_HEATER_5
#ifdef HEATER_5_MINTEMP
_TEMP_MIN_E(5);
#endif
#ifdef HEATER_5_MAXTEMP
_TEMP_MAX_E(5);
#endif
#if _MINMAX_TEST(2, MAX)
_TEMP_MAX_E(2);
#endif

#if HOTENDS > 6 && THERMISTOR_HEATER_6
#ifdef HEATER_6_MINTEMP
_TEMP_MIN_E(6);
#endif
#ifdef HEATER_6_MAXTEMP
_TEMP_MAX_E(6);
#endif
#if _MINMAX_TEST(3, MIN)
_TEMP_MIN_E(3);
#endif

#if HOTENDS > 7 && THERMISTOR_HEATER_7
#ifdef HEATER_7_MINTEMP
_TEMP_MIN_E(7);
#endif
#ifdef HEATER_7_MAXTEMP
_TEMP_MAX_E(7);
#endif
#if _MINMAX_TEST(3, MAX)
_TEMP_MAX_E(3);
#endif
#if _MINMAX_TEST(4, MIN)
_TEMP_MIN_E(4);
#endif
#if _MINMAX_TEST(4, MAX)
_TEMP_MAX_E(4);
#endif
#if _MINMAX_TEST(5, MIN)
_TEMP_MIN_E(5);
#endif
#if _MINMAX_TEST(5, MAX)
_TEMP_MAX_E(5);
#endif
#if _MINMAX_TEST(6, MIN)
_TEMP_MIN_E(6);
#endif
#if _MINMAX_TEST(6, MAX)
_TEMP_MAX_E(6);
#endif
#if _MINMAX_TEST(7, MIN)
_TEMP_MIN_E(7);
#endif
#if _MINMAX_TEST(7, MAX)
_TEMP_MAX_E(7);
#endif

#endif // HAS_HOTEND
Expand Down