Selaa lähdekoodia

Fix bug in lcd_preheat_pla0123 and lcd_preheat_abs0123

Trying to preheat a non-existent extruder causes a crash.
Scott Lahteine 8 vuotta sitten
vanhempi
commit
fda8f96f00
1 muutettua tiedostoa jossa 12 lisäystä ja 8 poistoa
  1. 12
    8
      Marlin/ultralcd.cpp

+ 12
- 8
Marlin/ultralcd.cpp Näytä tiedosto

@@ -789,16 +789,20 @@ void _lcd_preheat(int endnum, const float temph, const float tempb, const int fa
789 789
   #endif
790 790
 
791 791
   void lcd_preheat_pla0123() {
792
-    setTargetHotend0(plaPreheatHotendTemp);
793
-    setTargetHotend1(plaPreheatHotendTemp);
794
-    setTargetHotend2(plaPreheatHotendTemp);
795
-    _lcd_preheat(3, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed);
792
+    #if EXTRUDERS > 1
793
+      setTargetHotend0(plaPreheatHotendTemp);
794
+      setTargetHotend1(plaPreheatHotendTemp);
795
+      setTargetHotend2(plaPreheatHotendTemp);
796
+    #endif
797
+    _lcd_preheat(EXTRUDERS - 1, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed);
796 798
   }
797 799
   void lcd_preheat_abs0123() {
798
-    setTargetHotend0(absPreheatHotendTemp);
799
-    setTargetHotend1(absPreheatHotendTemp);
800
-    setTargetHotend2(absPreheatHotendTemp);
801
-    _lcd_preheat(3, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed);
800
+    #if EXTRUDERS > 1
801
+      setTargetHotend0(absPreheatHotendTemp);
802
+      setTargetHotend1(absPreheatHotendTemp);
803
+      setTargetHotend2(absPreheatHotendTemp);
804
+    #endif
805
+    _lcd_preheat(EXTRUDERS - 1, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed);
802 806
   }
803 807
 
804 808
 #endif // EXTRUDERS > 1

Loading…
Peruuta
Tallenna