Browse Source

Duplicate fan speed in M106/7 IDEX Duplication Mode (#21208)

Kachidoki 4 years ago
parent
commit
969268166e
No account linked to committer's email address
1 changed files with 10 additions and 2 deletions
  1. 10
    2
      Marlin/src/gcode/temp/M106_M107.cpp

+ 10
- 2
Marlin/src/gcode/temp/M106_M107.cpp View File

@@ -81,6 +81,9 @@ void GcodeSuite::M106() {
81 81
 
82 82
     // Set speed, with constraint
83 83
     thermalManager.set_fan_speed(pfan, speed);
84
+
85
+    if (TERN0(DUAL_X_CARRIAGE, idex_is_duplicating()))  // pfan == 0 when duplicating
86
+      thermalManager.set_fan_speed(1 - pfan, speed);
84 87
   }
85 88
 }
86 89
 
@@ -88,8 +91,13 @@ void GcodeSuite::M106() {
88 91
  * M107: Fan Off
89 92
  */
90 93
 void GcodeSuite::M107() {
91
-  const uint8_t p = parser.byteval('P', _ALT_P);
92
-  thermalManager.set_fan_speed(p, 0);
94
+  const uint8_t pfan = parser.byteval('P', _ALT_P);
95
+  if (pfan < _CNT_P) {
96
+    thermalManager.set_fan_speed(pfan, 0);
97
+
98
+    if (TERN0(DUAL_X_CARRIAGE, idex_is_duplicating()))  // pfan == 0 when duplicating
99
+      thermalManager.set_fan_speed(1 - pfan, 0);
100
+  }
93 101
 }
94 102
 
95 103
 #endif // HAS_FAN

Loading…
Cancel
Save