Browse Source

Fix Singlenozzle Standby issues (#21759)

Fixes #21758

Co-authored-by: Scott Lahteine <github@thinkyhead.com>
ellensp 3 years ago
parent
commit
ef9ca61039
No account linked to committer's email address

+ 10
- 0
Marlin/src/inc/Conditionals_LCD.h View File

@@ -641,6 +641,16 @@
641 641
 #endif
642 642
 
643 643
 /**
644
+ * Disable unused SINGLENOZZLE sub-options
645
+ */
646
+#if DISABLED(SINGLENOZZLE)
647
+  #undef SINGLENOZZLE_STANDBY_TEMP
648
+#endif
649
+#if !BOTH(HAS_FAN, SINGLENOZZLE)
650
+  #undef SINGLENOZZLE_STANDBY_FAN
651
+#endif
652
+
653
+/**
644 654
  * DISTINCT_E_FACTORS affects how some E factors are accessed
645 655
  */
646 656
 #if ENABLED(DISTINCT_E_FACTORS) && E_STEPPERS > 1

+ 1
- 1
Marlin/src/lcd/menu/menu_temperature.cpp View File

@@ -171,7 +171,7 @@ void menu_temperature() {
171 171
 
172 172
   #if ENABLED(SINGLENOZZLE_STANDBY_TEMP)
173 173
     LOOP_S_L_N(e, 1, EXTRUDERS)
174
-      EDIT_ITEM_FAST_N(uint16_3, e, MSG_NOZZLE_STANDBY, &thermalManager.singlenozzle_temp[e], 0, thermalManager.hotend_max_target(0));
174
+      EDIT_ITEM_FAST_N(int3, e, MSG_NOZZLE_STANDBY, &thermalManager.singlenozzle_temp[e], 0, thermalManager.hotend_max_target(0));
175 175
   #endif
176 176
 
177 177
   //

+ 1
- 1
Marlin/src/lcd/menu/menu_tune.cpp View File

@@ -134,7 +134,7 @@ void menu_tune() {
134 134
 
135 135
   #if ENABLED(SINGLENOZZLE_STANDBY_TEMP)
136 136
     LOOP_S_L_N(e, 1, EXTRUDERS)
137
-      EDIT_ITEM_FAST_N(uint16_3, e, MSG_NOZZLE_STANDBY, &thermalManager.singlenozzle_temp[e], 0, thermalManager.hotend_max_target(0));
137
+      EDIT_ITEM_FAST_N(int3, e, MSG_NOZZLE_STANDBY, &thermalManager.singlenozzle_temp[e], 0, thermalManager.hotend_max_target(0));
138 138
   #endif
139 139
 
140 140
   //

+ 14
- 12
Marlin/src/module/temperature.cpp View File

@@ -466,9 +466,9 @@ volatile bool Temperature::raw_temps_ready = false;
466 466
 
467 467
 #if ENABLED(SINGLENOZZLE_STANDBY_TEMP)
468 468
   celsius_t Temperature::singlenozzle_temp[EXTRUDERS];
469
-  #if HAS_FAN
470
-    uint8_t Temperature::singlenozzle_fan_speed[EXTRUDERS];
471
-  #endif
469
+#endif
470
+#if ENABLED(SINGLENOZZLE_STANDBY_FAN)
471
+  uint8_t Temperature::singlenozzle_fan_speed[EXTRUDERS];
472 472
 #endif
473 473
 
474 474
 #if ENABLED(PROBING_HEATERS_OFF)
@@ -2500,20 +2500,22 @@ void Temperature::disable_all_heaters() {
2500 2500
 
2501 2501
 #endif // PROBING_HEATERS_OFF
2502 2502
 
2503
-#if ENABLED(SINGLENOZZLE_STANDBY_TEMP)
2503
+#if EITHER(SINGLENOZZLE_STANDBY_TEMP, SINGLENOZZLE_STANDBY_FAN)
2504 2504
 
2505 2505
   void Temperature::singlenozzle_change(const uint8_t old_tool, const uint8_t new_tool) {
2506
-    #if HAS_FAN
2506
+    #if ENABLED(SINGLENOZZLE_STANDBY_FAN)
2507 2507
       singlenozzle_fan_speed[old_tool] = fan_speed[0];
2508 2508
       fan_speed[0] = singlenozzle_fan_speed[new_tool];
2509 2509
     #endif
2510
-    singlenozzle_temp[old_tool] = temp_hotend[0].target;
2511
-    if (singlenozzle_temp[new_tool] && singlenozzle_temp[new_tool] != singlenozzle_temp[old_tool]) {
2512
-      setTargetHotend(singlenozzle_temp[new_tool], 0);
2513
-      TERN_(AUTOTEMP, planner.autotemp_update());
2514
-      TERN_(HAS_STATUS_MESSAGE, set_heating_message(0));
2515
-      (void)wait_for_hotend(0, false);  // Wait for heating or cooling
2516
-    }
2510
+    #if ENABLED(SINGLENOZZLE_STANDBY_TEMP)
2511
+      singlenozzle_temp[old_tool] = temp_hotend[0].target;
2512
+      if (singlenozzle_temp[new_tool] && singlenozzle_temp[new_tool] != singlenozzle_temp[old_tool]) {
2513
+        setTargetHotend(singlenozzle_temp[new_tool], 0);
2514
+        TERN_(AUTOTEMP, planner.autotemp_update());
2515
+        TERN_(HAS_STATUS_MESSAGE, set_heating_message(0));
2516
+        (void)wait_for_hotend(0, false);  // Wait for heating or cooling
2517
+      }
2518
+    #endif
2517 2519
   }
2518 2520
 
2519 2521
 #endif

+ 5
- 3
Marlin/src/module/temperature.h View File

@@ -372,9 +372,11 @@ class Temperature {
372 372
     static inline bool hotEnoughToExtrude(const uint8_t e) { return !tooColdToExtrude(e); }
373 373
     static inline bool targetHotEnoughToExtrude(const uint8_t e) { return !targetTooColdToExtrude(e); }
374 374
 
375
-    #if ENABLED(SINGLENOZZLE_STANDBY_FAN)
376
-      static celsius_t singlenozzle_temp[EXTRUDERS];
377
-      #if HAS_FAN
375
+    #if EITHER(SINGLENOZZLE_STANDBY_TEMP, SINGLENOZZLE_STANDBY_FAN)
376
+      #if ENABLED(SINGLENOZZLE_STANDBY_TEMP)
377
+        static celsius_t singlenozzle_temp[EXTRUDERS];
378
+      #endif
379
+      #if ENABLED(SINGLENOZZLE_STANDBY_FAN)
378 380
         static uint8_t singlenozzle_fan_speed[EXTRUDERS];
379 381
       #endif
380 382
       static void singlenozzle_change(const uint8_t old_tool, const uint8_t new_tool);

+ 3
- 1
Marlin/src/module/tool_change.cpp View File

@@ -1194,7 +1194,9 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
1194 1194
       const bool should_move = safe_to_move && !no_move && IsRunning();
1195 1195
       if (should_move) {
1196 1196
 
1197
-        TERN_(SINGLENOZZLE_STANDBY_TEMP, thermalManager.singlenozzle_change(old_tool, new_tool));
1197
+        #if EITHER(SINGLENOZZLE_STANDBY_TEMP, SINGLENOZZLE_STANDBY_FAN)
1198
+          thermalManager.singlenozzle_change(old_tool, new_tool);
1199
+        #endif
1198 1200
 
1199 1201
         #if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
1200 1202
           if (should_swap && !too_cold) {

Loading…
Cancel
Save