Browse Source

Limit preheat parameters based on all nozzles

Scott Lahteine 8 years ago
parent
commit
c9193e856d
2 changed files with 17 additions and 2 deletions
  1. 3
    1
      Marlin/macros.h
  2. 14
    1
      Marlin/ultralcd.cpp

+ 3
- 1
Marlin/macros.h View File

@@ -126,8 +126,10 @@
126 126
 
127 127
 #define CEILING(x,y) (((x) + (y) - 1) / (y))
128 128
 
129
+#define MIN3(a, b, c)    min(min(a, b), c)
130
+#define MIN4(a, b, c, d) min(min(a, b), min(c, d))
129 131
 #define MAX3(a, b, c)    max(max(a, b), c)
130
-#define MAX4(a, b, c, d) max(max(max(a, b), c), d)
132
+#define MAX4(a, b, c, d) max(max(a, b), max(c, d))
131 133
 
132 134
 #define UNEAR_ZERO(x) ((x) < 0.000001)
133 135
 #define NEAR_ZERO(x) ((x) > -0.000001 && (x) < 0.000001)

+ 14
- 1
Marlin/ultralcd.cpp View File

@@ -1788,11 +1788,24 @@ void kill_screen(const char* lcd_msg) {
1788 1788
   }
1789 1789
 
1790 1790
   void _lcd_control_temperature_preheat_settings_menu(uint8_t material) {
1791
+    #if HOTENDS > 3
1792
+      #define MINTEMP_ALL MIN4(HEATER_0_MINTEMP, HEATER_1_MINTEMP, HEATER_2_MINTEMP, HEATER_3_MINTEMP)
1793
+      #define MAXTEMP_ALL MAX4(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP)
1794
+    #elif HOTENDS > 2
1795
+      #define MINTEMP_ALL MIN3(HEATER_0_MINTEMP, HEATER_1_MINTEMP, HEATER_2_MINTEMP)
1796
+      #define MAXTEMP_ALL MAX3(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP)
1797
+    #elif HOTENDS > 1
1798
+      #define MINTEMP_ALL min(HEATER_0_MINTEMP, HEATER_1_MINTEMP)
1799
+      #define MAXTEMP_ALL max(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP)
1800
+    #else
1801
+      #define MINTEMP_ALL HEATER_0_MINTEMP
1802
+      #define MAXTEMP_ALL HEATER_0_MAXTEMP
1803
+    #endif
1791 1804
     START_MENU();
1792 1805
     MENU_BACK(MSG_TEMPERATURE);
1793 1806
     MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &lcd_preheat_fan_speed[material], 0, 255);
1794 1807
     #if TEMP_SENSOR_0 != 0
1795
-      MENU_ITEM_EDIT(int3, MSG_NOZZLE, &lcd_preheat_hotend_temp[material], HEATER_0_MINTEMP, HEATER_0_MAXTEMP - 15);
1808
+      MENU_ITEM_EDIT(int3, MSG_NOZZLE, &lcd_preheat_hotend_temp[material], MINTEMP_ALL, MAXTEMP_ALL - 15);
1796 1809
     #endif
1797 1810
     #if TEMP_SENSOR_BED != 0
1798 1811
       MENU_ITEM_EDIT(int3, MSG_BED, &lcd_preheat_bed_temp[material], BED_MINTEMP, BED_MAXTEMP - 15);

Loading…
Cancel
Save