diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 3496a971..25c005c5 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -394,6 +394,8 @@ static bool saved_extruder_relative_mode = false; static int saved_fanSpeed = 0; //!< Print fan speed //! @} +static int saved_feedmultiply_mm = 100; + //=========================================================================== //=============================Routines====================================== //=========================================================================== @@ -6078,12 +6080,20 @@ Sigma_Exit: SERIAL_ECHOLN(""); }break; #endif + case 220: // M220 S- set speed factor override percentage { - if(code_seen('S')) + if (code_seen('B')) //backup current speed factor { + saved_feedmultiply_mm = feedmultiply; + } + if(code_seen('S')) + { feedmultiply = code_value() ; } + if (code_seen('R')) { //restore previous feedmultiply + feedmultiply = saved_feedmultiply_mm; + } } break; case 221: // M221 S- set extrude factor override percentage