瀏覽代碼

Add M220 B/R with PRUSA_MMU2 (#15739)

lukasmatena 5 年之前
父節點
當前提交
8ccfdaca02
共有 2 個文件被更改,包括 16 次插入3 次删除
  1. 15
    3
      Marlin/src/gcode/config/M220.cpp
  2. 1
    0
      Marlin/src/gcode/gcode.h

+ 15
- 3
Marlin/src/gcode/config/M220.cpp 查看文件

@@ -24,11 +24,23 @@
24 24
 #include "../../module/motion.h"
25 25
 
26 26
 /**
27
- * M220: Set speed percentage factor, aka "Feed Rate" (M220 S95)
27
+ * M220: Set speed percentage factor, aka "Feed Rate"
28
+ *
29
+ * Parameters
30
+ *   S<percent> : Set the feed rate percentage factor
31
+ *
32
+ * With PRUSA_MMU2...
33
+ *   B : Flag to back up the current factor
34
+ *   R : Flag to restore the last-saved factor
28 35
  */
29 36
 void GcodeSuite::M220() {
30 37
 
31
-  if (parser.seenval('S'))
32
-    feedrate_percentage = parser.value_int();
38
+  #if ENABLED(PRUSA_MMU2)
39
+    static int16_t backup_feedrate_percentage = 100;
40
+    if (parser.seen('B')) backup_feedrate_percentage = feedrate_percentage;
41
+    if (parser.seen('R')) feedrate_percentage = backup_feedrate_percentage;
42
+  #endif
43
+
44
+  if (parser.seenval('S')) feedrate_percentage = parser.value_int();
33 45
 
34 46
 }

+ 1
- 0
Marlin/src/gcode/gcode.h 查看文件

@@ -177,6 +177,7 @@
177 177
  * M217 - Set filament swap parameters: "M217 S<length> P<feedrate> R<feedrate>". (Requires SINGLENOZZLE)
178 178
  * M218 - Set/get a tool offset: "M218 T<index> X<offset> Y<offset>". (Requires 2 or more extruders)
179 179
  * M220 - Set Feedrate Percentage: "M220 S<percent>" (i.e., "FR" on the LCD)
180
+ *        Use "M220 B" to back up the Feedrate Percentage and "M220 R" to restore it. (Requires PRUSA_MMU2)
180 181
  * M221 - Set Flow Percentage: "M221 S<percent>"
181 182
  * M226 - Wait until a pin is in a given state: "M226 P<pin> S<state>"
182 183
  * M240 - Trigger a camera to take a photograph. (Requires PHOTO_GCODE)

Loading…
取消
儲存