From 57f92a46320d1f4c556954c836fe8a36821564e4 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 18 Feb 2017 04:33:25 -0600 Subject: [PATCH] Apply DISTINCT_E_FACTORS to sync_from_steppers Followup to #5840 --- Marlin/planner.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index aa163e22f..459e0b11d 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -1416,10 +1416,16 @@ void Planner::set_position_mm_kinematic(const float position[NUM_AXIS]) { * Sync from the stepper positions. (e.g., after an interrupted move) */ void Planner::sync_from_steppers() { - LOOP_XYZE(i) position[i] = stepper.position((AxisEnum)i); - #if ENABLED(LIN_ADVANCE) - LOOP_XYZE(i) position_float[i] = stepper.position((AxisEnum)i) * (i == E_AXIS ? steps_to_mm[E_AXIS + active_extruder] : steps_to_mm[i]); - #endif + LOOP_XYZE(i) { + position[i] = stepper.position((AxisEnum)i); + #if ENABLED(LIN_ADVANCE) + position_float[i] = position[i] * steps_to_mm[i + #if ENABLED(DISTINCT_E_FACTORS) + + (i == E_AXIS ? active_extruder : 0) + #endif + ]; + #endif + } } /**