Skip to content

Commit

Permalink
Merge pull request prusa3d#1369 from PavelSindler/M220_MK3
Browse files Browse the repository at this point in the history
M220: possibility to backup/restore speed
  • Loading branch information
XPila authored Nov 30, 2018
2 parents 23e8d6a + d1d4a8c commit 1948cb6
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Firmware/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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======================================
//===========================================================================
Expand Down Expand Up @@ -6078,12 +6080,20 @@ SERIAL_PROTOCOLPGM("\n\n");
SERIAL_ECHOLN("");
}break;
#endif

case 220: // M220 S<factor in percent>- 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<factor in percent>- set extrude factor override percentage
Expand Down

0 comments on commit 1948cb6

Please sign in to comment.