|
@@ -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
|
}
|