Pārlūkot izejas kodu

Fix Singlenozzle Standby issues (#21759)

Fixes #21758

Co-authored-by: Scott Lahteine <github@thinkyhead.com>
ellensp 4 gadus atpakaļ
vecāks
revīzija
ef9ca61039
Revīzijas autora e-pasta adrese nav piesaistīta nevienam kontam

+ 10
- 0
Marlin/src/inc/Conditionals_LCD.h Parādīt failu

641
 #endif
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
  * DISTINCT_E_FACTORS affects how some E factors are accessed
654
  * DISTINCT_E_FACTORS affects how some E factors are accessed
645
  */
655
  */
646
 #if ENABLED(DISTINCT_E_FACTORS) && E_STEPPERS > 1
656
 #if ENABLED(DISTINCT_E_FACTORS) && E_STEPPERS > 1

+ 1
- 1
Marlin/src/lcd/menu/menu_temperature.cpp Parādīt failu

171
 
171
 
172
   #if ENABLED(SINGLENOZZLE_STANDBY_TEMP)
172
   #if ENABLED(SINGLENOZZLE_STANDBY_TEMP)
173
     LOOP_S_L_N(e, 1, EXTRUDERS)
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
   #endif
175
   #endif
176
 
176
 
177
   //
177
   //

+ 1
- 1
Marlin/src/lcd/menu/menu_tune.cpp Parādīt failu

134
 
134
 
135
   #if ENABLED(SINGLENOZZLE_STANDBY_TEMP)
135
   #if ENABLED(SINGLENOZZLE_STANDBY_TEMP)
136
     LOOP_S_L_N(e, 1, EXTRUDERS)
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
   #endif
138
   #endif
139
 
139
 
140
   //
140
   //

+ 14
- 12
Marlin/src/module/temperature.cpp Parādīt failu

466
 
466
 
467
 #if ENABLED(SINGLENOZZLE_STANDBY_TEMP)
467
 #if ENABLED(SINGLENOZZLE_STANDBY_TEMP)
468
   celsius_t Temperature::singlenozzle_temp[EXTRUDERS];
468
   celsius_t Temperature::singlenozzle_temp[EXTRUDERS];
469
-  #if HAS_FAN
469
+#endif
470
-    uint8_t Temperature::singlenozzle_fan_speed[EXTRUDERS];
470
+#if ENABLED(SINGLENOZZLE_STANDBY_FAN)
471
-  #endif
471
+  uint8_t Temperature::singlenozzle_fan_speed[EXTRUDERS];
472
 #endif
472
 #endif
473
 
473
 
474
 #if ENABLED(PROBING_HEATERS_OFF)
474
 #if ENABLED(PROBING_HEATERS_OFF)
2500
 
2500
 
2501
 #endif // PROBING_HEATERS_OFF
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
   void Temperature::singlenozzle_change(const uint8_t old_tool, const uint8_t new_tool) {
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
       singlenozzle_fan_speed[old_tool] = fan_speed[0];
2507
       singlenozzle_fan_speed[old_tool] = fan_speed[0];
2508
       fan_speed[0] = singlenozzle_fan_speed[new_tool];
2508
       fan_speed[0] = singlenozzle_fan_speed[new_tool];
2509
     #endif
2509
     #endif
2510
-    singlenozzle_temp[old_tool] = temp_hotend[0].target;
2510
+    #if ENABLED(SINGLENOZZLE_STANDBY_TEMP)
2511
-    if (singlenozzle_temp[new_tool] && singlenozzle_temp[new_tool] != singlenozzle_temp[old_tool]) {
2511
+      singlenozzle_temp[old_tool] = temp_hotend[0].target;
2512
-      setTargetHotend(singlenozzle_temp[new_tool], 0);
2512
+      if (singlenozzle_temp[new_tool] && singlenozzle_temp[new_tool] != singlenozzle_temp[old_tool]) {
2513
-      TERN_(AUTOTEMP, planner.autotemp_update());
2513
+        setTargetHotend(singlenozzle_temp[new_tool], 0);
2514
-      TERN_(HAS_STATUS_MESSAGE, set_heating_message(0));
2514
+        TERN_(AUTOTEMP, planner.autotemp_update());
2515
-      (void)wait_for_hotend(0, false);  // Wait for heating or cooling
2515
+        TERN_(HAS_STATUS_MESSAGE, set_heating_message(0));
2516
-    }
2516
+        (void)wait_for_hotend(0, false);  // Wait for heating or cooling
2517
+      }
2518
+    #endif
2517
   }
2519
   }
2518
 
2520
 
2519
 #endif
2521
 #endif

+ 5
- 3
Marlin/src/module/temperature.h Parādīt failu

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

+ 3
- 1
Marlin/src/module/tool_change.cpp Parādīt failu

1194
       const bool should_move = safe_to_move && !no_move && IsRunning();
1194
       const bool should_move = safe_to_move && !no_move && IsRunning();
1195
       if (should_move) {
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
         #if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
1201
         #if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
1200
           if (should_swap && !too_cold) {
1202
           if (should_swap && !too_cold) {

Notiek ielāde…
Atcelt
Saglabāt