Browse Source

Don't set heater temperature above its maximum

Scott Lahteine 8 years ago
parent
commit
0951d385ce
1 changed files with 3 additions and 2 deletions
  1. 3
    2
      Marlin/ultralcd.cpp

+ 3
- 2
Marlin/ultralcd.cpp View File

883
     }
883
     }
884
   #endif
884
   #endif
885
 
885
 
886
+  constexpr int heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP);
887
+
886
   /**
888
   /**
887
    *
889
    *
888
    * "Prepare" submenu items
890
    * "Prepare" submenu items
889
    *
891
    *
890
    */
892
    */
891
   void _lcd_preheat(int endnum, const float temph, const float tempb, const int fan) {
893
   void _lcd_preheat(int endnum, const float temph, const float tempb, const int fan) {
892
-    if (temph > 0) thermalManager.setTargetHotend(temph, endnum);
894
+    if (temph > 0) thermalManager.setTargetHotend(min(heater_maxtemp[endnum], temph), endnum);
893
     #if TEMP_SENSOR_BED != 0
895
     #if TEMP_SENSOR_BED != 0
894
       thermalManager.setTargetBed(tempb);
896
       thermalManager.setTargetBed(tempb);
895
     #else
897
     #else
1583
 
1585
 
1584
     #if ENABLED(PIDTEMP)
1586
     #if ENABLED(PIDTEMP)
1585
       int autotune_temp[HOTENDS] = ARRAY_BY_HOTENDS1(150);
1587
       int autotune_temp[HOTENDS] = ARRAY_BY_HOTENDS1(150);
1586
-      const int heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP);
1587
     #endif
1588
     #endif
1588
 
1589
 
1589
     #if ENABLED(PIDTEMPBED)
1590
     #if ENABLED(PIDTEMPBED)

Loading…
Cancel
Save