From a8057e0d363c6eec0371ef1504c532137a6deebf Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Thu, 29 Dec 2022 15:25:00 +0100 Subject: [PATCH] wizard: Disable temperature model during hotend testing This avoids confusing error messages if the hotend is defective and caught by selftest itself. Rearrange Stopped state checks (saves 2 bytes) --- Firmware/ultralcd.cpp | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 910b545c2..f02694ccf 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -7025,6 +7025,10 @@ static bool lcd_selfcheck_check_heater(bool _isbed) target_temperature[0] = (_isbed) ? 0 : 200; target_temperature_bed = (_isbed) ? 100 : 0; +#ifdef TEMP_MODEL + bool tm_was_enabled = temp_model_enabled(); + temp_model_set_enabled(false); +#endif //TEMP_MODEL manage_heater(); manage_inactivity(true); @@ -7061,26 +7065,21 @@ static bool lcd_selfcheck_check_heater(bool _isbed) */ bool _stepresult = false; - if (Stopped) + if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) { - // thermal error occurred while heating the nozzle - lcd_selftest_error(TestError::Heater, "", ""); + if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) + _stepresult = true; + else + lcd_selftest_error(TestError::Heater, "", ""); } else { - if (_opposite_result < ((_isbed) ? 30 : 9)) - { - if (_checked_result >= ((_isbed) ? 9 : 30)) - _stepresult = true; - else - lcd_selftest_error(TestError::Heater, "", ""); - } - else - { - lcd_selftest_error(TestError::Bed, "", ""); - } + lcd_selftest_error(TestError::Bed, "", ""); } +#ifdef TEMP_MODEL + temp_model_set_enabled(tm_was_enabled); +#endif //TEMP_MODEL manage_heater(); manage_inactivity(true); return _stepresult;