Przeglądaj źródła

Merge pull request #10772 from GMagician/2.0.x-address-#10766

[2.0.x] Fix switching extruder
Scott Lahteine 7 lat temu
rodzic
commit
fe7aea7bf6
No account linked to committer's email address

+ 2
- 2
Marlin/src/Marlin.cpp Wyświetl plik

@@ -146,7 +146,7 @@
146 146
   #include "feature/fanmux.h"
147 147
 #endif
148 148
 
149
-#if (ENABLED(SWITCHING_EXTRUDER) && !DONT_SWITCH) || ENABLED(SWITCHING_NOZZLE) || ENABLED(PARKING_EXTRUDER)
149
+#if DO_SWITCH_EXTRUDER || ENABLED(SWITCHING_NOZZLE) || ENABLED(PARKING_EXTRUDER)
150 150
   #include "module/tool_change.h"
151 151
 #endif
152 152
 
@@ -864,7 +864,7 @@ void setup() {
864 864
     setup_endstop_interrupts();
865 865
   #endif
866 866
 
867
-  #if ENABLED(SWITCHING_EXTRUDER) && !DONT_SWITCH
867
+  #if DO_SWITCH_EXTRUDER
868 868
     move_extruder_servo(0);  // Initialize extruder servo
869 869
   #endif
870 870
 

+ 3
- 3
Marlin/src/gcode/config/M218.cpp Wyświetl plik

@@ -37,7 +37,7 @@
37 37
  *   T<tool>
38 38
  *   X<xoffset>
39 39
  *   Y<yoffset>
40
- *   Z<zoffset> - Available with DUAL_X_CARRIAGE and SWITCHING_NOZZLE
40
+ *   Z<zoffset> - Available with DUAL_X_CARRIAGE, SWITCHING_NOZZLE and PARKING_EXTRUDER
41 41
  */
42 42
 void GcodeSuite::M218() {
43 43
   if (get_target_extruder_from_command() || target_extruder == 0) return;
@@ -52,7 +52,7 @@ void GcodeSuite::M218() {
52 52
     report = false;
53 53
   }
54 54
 
55
-  #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(SWITCHING_NOZZLE) || ENABLED(PARKING_EXTRUDER)
55
+  #if HAS_HOTEND_OFFSET_Z
56 56
     if (parser.seenval('Z')) {
57 57
       hotend_offset[Z_AXIS][target_extruder] = parser.value_linear_units();
58 58
       report = false;
@@ -67,7 +67,7 @@ void GcodeSuite::M218() {
67 67
       SERIAL_ECHO(hotend_offset[X_AXIS][e]);
68 68
       SERIAL_CHAR(',');
69 69
       SERIAL_ECHO(hotend_offset[Y_AXIS][e]);
70
-      #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(SWITCHING_NOZZLE) || ENABLED(PARKING_EXTRUDER)
70
+      #if HAS_HOTEND_OFFSET_Z
71 71
         SERIAL_CHAR(',');
72 72
         SERIAL_ECHO(hotend_offset[Z_AXIS][e]);
73 73
       #endif

+ 2
- 3
Marlin/src/inc/Conditionals_LCD.h Wyświetl plik

@@ -413,9 +413,6 @@
413 413
   #undef HOTEND_OFFSET_Y
414 414
 #else                                                         // Two hotends
415 415
   #define HOTENDS       EXTRUDERS
416
-  #if ENABLED(SWITCHING_NOZZLE) && !defined(HOTEND_OFFSET_Z)
417
-    #define HOTEND_OFFSET_Z { 0 }
418
-  #endif
419 416
 #endif
420 417
 
421 418
 #define HOTEND_LOOP() for (int8_t e = 0; e < HOTENDS; e++)
@@ -445,6 +442,8 @@
445 442
   #define E_MANUAL        EXTRUDERS
446 443
 #endif
447 444
 
445
+#define DO_SWITCH_EXTRUDER (ENABLED(SWITCHING_EXTRUDER) && (DISABLED(SWITCHING_NOZZLE) || SWITCHING_EXTRUDER_SERVO_NR != SWITCHING_NOZZLE_SERVO_NR))
446
+
448 447
 /**
449 448
  * DISTINCT_E_FACTORS affects how some E factors are accessed
450 449
  */

+ 2
- 1
Marlin/src/inc/Conditionals_post.h Wyświetl plik

@@ -434,6 +434,7 @@
434 434
 /**
435 435
  * Default hotend offsets, if not defined
436 436
  */
437
+#define HAS_HOTEND_OFFSET_Z (HOTENDS > 1 && (ENABLED(DUAL_X_CARRIAGE) || ENABLED(SWITCHING_NOZZLE) || ENABLED(PARKING_EXTRUDER)))
437 438
 #if HOTENDS > 1
438 439
   #ifndef HOTEND_OFFSET_X
439 440
     #define HOTEND_OFFSET_X { 0 } // X offsets for each extruder
@@ -441,7 +442,7 @@
441 442
   #ifndef HOTEND_OFFSET_Y
442 443
     #define HOTEND_OFFSET_Y { 0 } // Y offsets for each extruder
443 444
   #endif
444
-  #if !defined(HOTEND_OFFSET_Z) && (ENABLED(DUAL_X_CARRIAGE) || ENABLED(SWITCHING_NOZZLE))
445
+  #if HAS_HOTEND_OFFSET_Z && !defined(HOTEND_OFFSET_Z)
445 446
     #define HOTEND_OFFSET_Z { 0 }
446 447
   #endif
447 448
 #endif

+ 1
- 1
Marlin/src/lcd/ultralcd.cpp Wyświetl plik

@@ -3270,7 +3270,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
3270 3270
     else
3271 3271
       MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
3272 3272
 
3273
-    #if ENABLED(SWITCHING_EXTRUDER)
3273
+    #if ENABLED(SWITCHING_EXTRUDER) || ENABLED(SWITCHING_NOZZLE)
3274 3274
 
3275 3275
       #if EXTRUDERS == 4
3276 3276
         switch (active_extruder) {

+ 1
- 1
Marlin/src/module/configuration_store.cpp Wyświetl plik

@@ -2126,7 +2126,7 @@ void MarlinSettings::reset(PORTARG_SOLO) {
2126 2126
         SERIAL_ECHOPAIR_P(port, "  M218 T", (int)e);
2127 2127
         SERIAL_ECHOPAIR_P(port, " X", LINEAR_UNIT(hotend_offset[X_AXIS][e]));
2128 2128
         SERIAL_ECHOPAIR_P(port, " Y", LINEAR_UNIT(hotend_offset[Y_AXIS][e]));
2129
-        #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(SWITCHING_NOZZLE) ||ENABLED(PARKING_EXTRUDER)
2129
+        #if HAS_HOTEND_OFFSET_Z
2130 2130
           SERIAL_ECHOPAIR_P(port, " Z", LINEAR_UNIT(hotend_offset[Z_AXIS][e]));
2131 2131
         #endif
2132 2132
         SERIAL_EOL_P(port);

+ 1
- 3
Marlin/src/module/tool_change.cpp Wyświetl plik

@@ -57,7 +57,7 @@
57 57
   #include "../feature/fanmux.h"
58 58
 #endif
59 59
 
60
-#if ENABLED(SWITCHING_EXTRUDER)
60
+#if DO_SWITCH_EXTRUDER
61 61
 
62 62
   #if EXTRUDERS > 3
63 63
     #define REQ_ANGLES 4
@@ -347,8 +347,6 @@ inline void invalid_extruder_error(const uint8_t e) {
347 347
 
348 348
 #endif // DUAL_X_CARRIAGE
349 349
 
350
-#define DO_SWITCH_EXTRUDER (SWITCHING_EXTRUDER_SERVO_NR != SWITCHING_NOZZLE_SERVO_NR)
351
-
352 350
 /**
353 351
  * Perform a tool-change, which may result in moving the
354 352
  * previous tool out of the way and the new tool into place.

+ 1
- 1
Marlin/src/module/tool_change.h Wyświetl plik

@@ -25,7 +25,7 @@
25 25
 
26 26
 #include "../inc/MarlinConfig.h"
27 27
 
28
-#if ENABLED(SWITCHING_EXTRUDER)
28
+#if DO_SWITCH_EXTRUDER
29 29
   void move_extruder_servo(const uint8_t e);
30 30
 #endif
31 31
 

Ładowanie…
Anuluj
Zapisz