Browse Source

Add M220 B/R with PRUSA_MMU2 (#15739)

pull/1/head
lukasmatena 5 years ago
committed by Scott Lahteine
parent
commit
8ccfdaca02
  1. 18
      Marlin/src/gcode/config/M220.cpp
  2. 1
      Marlin/src/gcode/gcode.h

18
Marlin/src/gcode/config/M220.cpp

@ -24,11 +24,23 @@
#include "../../module/motion.h" #include "../../module/motion.h"
/** /**
* M220: Set speed percentage factor, aka "Feed Rate" (M220 S95) * M220: Set speed percentage factor, aka "Feed Rate"
*
* Parameters
* S<percent> : Set the feed rate percentage factor
*
* With PRUSA_MMU2...
* B : Flag to back up the current factor
* R : Flag to restore the last-saved factor
*/ */
void GcodeSuite::M220() { void GcodeSuite::M220() {
if (parser.seenval('S')) #if ENABLED(PRUSA_MMU2)
feedrate_percentage = parser.value_int(); static int16_t backup_feedrate_percentage = 100;
if (parser.seen('B')) backup_feedrate_percentage = feedrate_percentage;
if (parser.seen('R')) feedrate_percentage = backup_feedrate_percentage;
#endif
if (parser.seenval('S')) feedrate_percentage = parser.value_int();
} }

1
Marlin/src/gcode/gcode.h

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

Loading…
Cancel
Save