Ver Fonte

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)
Yuri D'Elia há 2 anos atrás
pai
commit
dd99b1ab32
1 ficheiros alterados com 13 adições e 14 exclusões
  1. 13 14
      Firmware/ultralcd.cpp

+ 13 - 14
Firmware/ultralcd.cpp

@@ -6821,6 +6821,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);
 
@@ -6857,26 +6861,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;