Split G10/G11 into separate functions

This commit is contained in:
Scott Lahteine 2017-07-18 01:37:54 -05:00
parent c45798694f
commit 7afafb05b8

View file

@ -3403,20 +3403,24 @@ inline void gcode_G4() {
/** /**
* G10 - Retract filament according to settings of M207 * G10 - Retract filament according to settings of M207
* G11 - Recover filament according to settings of M208
*/ */
inline void gcode_G10_G11(bool doRetract=false) { inline void gcode_G10() {
#if EXTRUDERS > 1 #if EXTRUDERS > 1
if (doRetract) const bool rs = parser.boolval('S');
retracted_swap[active_extruder] = parser.boolval('S'); // checks for swap retract argument retracted_swap[active_extruder] = rs; // Use 'S' for swap, default to false
#endif #endif
retract(doRetract retract(true
#if EXTRUDERS > 1 #if EXTRUDERS > 1
, retracted_swap[active_extruder] , rs
#endif #endif
); );
} }
/**
* G11 - Recover filament according to settings of M208
*/
inline void gcode_G11() { retract(false); }
#endif // FWRETRACT #endif // FWRETRACT
#if ENABLED(NOZZLE_CLEAN_FEATURE) #if ENABLED(NOZZLE_CLEAN_FEATURE)
@ -10450,8 +10454,8 @@ void process_next_command() {
// G2, G3 // G2, G3
#if ENABLED(ARC_SUPPORT) && DISABLED(SCARA) #if ENABLED(ARC_SUPPORT) && DISABLED(SCARA)
case 2: // G2 - CW ARC case 2: // G2: CW ARC
case 3: // G3 - CCW ARC case 3: // G3: CCW ARC
gcode_G2_G3(parser.codenum == 2); gcode_G2_G3(parser.codenum == 2);
break; break;
#endif #endif
@ -10462,16 +10466,17 @@ void process_next_command() {
break; break;
#if ENABLED(BEZIER_CURVE_SUPPORT) #if ENABLED(BEZIER_CURVE_SUPPORT)
// G5 case 5: // G5: Cubic B_spline
case 5: // G5 - Cubic B_spline
gcode_G5(); gcode_G5();
break; break;
#endif // BEZIER_CURVE_SUPPORT #endif // BEZIER_CURVE_SUPPORT
#if ENABLED(FWRETRACT) #if ENABLED(FWRETRACT)
case 10: // G10: retract case 10: // G10: retract
gcode_G10();
break;
case 11: // G11: retract_recover case 11: // G11: retract_recover
gcode_G10_G11(parser.codenum == 10); gcode_G11();
break; break;
#endif // FWRETRACT #endif // FWRETRACT