Merge pull request #1369 from PavelSindler/M220_MK3

M220: possibility to backup/restore speed
This commit is contained in:
XPila 2018-11-30 19:02:45 +01:00 committed by GitHub
commit 1948cb6310
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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<factor in percent>- set speed factor override percentage
{
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