Replace MIN_RETRACT with MIN_AUTORETRACT, MAX_AUTORETRACT

This commit is contained in:
Scott Lahteine
2017-07-24 12:13:25 -05:00
parent 283d15a8d0
commit 423b0f3a1e
30 changed files with 91 additions and 55 deletions

View File

@@ -3281,7 +3281,7 @@ inline void gcode_G0_G1(
if (autoretract_enabled && !(parser.seen('X') || parser.seen('Y') || parser.seen('Z')) && parser.seen('E')) {
const float echange = destination[E_AXIS] - current_position[E_AXIS];
// Is this move an attempt to retract or recover?
if ((echange < -(MIN_RETRACT) && !retracted[active_extruder]) || (echange > MIN_RETRACT && retracted[active_extruder])) {
if (WITHIN(FABS(echange), MIN_AUTORETRACT, MAX_AUTORETRACT) && retracted[active_extruder] == (echange > 0.0)) {
current_position[E_AXIS] = destination[E_AXIS]; // hide the slicer-generated retract/recover from calculations
sync_plan_position_e(); // AND from the planner
retract(!retracted[active_extruder]);