Browse Source

Apply DISTINCT_E_FACTORS to sync_from_steppers

Followup to #5840
Scott Lahteine 7 years ago
parent
commit
57f92a4632
1 changed files with 10 additions and 4 deletions
  1. 10
    4
      Marlin/planner.cpp

+ 10
- 4
Marlin/planner.cpp View File

@@ -1416,10 +1416,16 @@ void Planner::set_position_mm_kinematic(const float position[NUM_AXIS]) {
1416 1416
  * Sync from the stepper positions. (e.g., after an interrupted move)
1417 1417
  */
1418 1418
 void Planner::sync_from_steppers() {
1419
-  LOOP_XYZE(i) position[i] = stepper.position((AxisEnum)i);
1420
-  #if ENABLED(LIN_ADVANCE)
1421
-    LOOP_XYZE(i) position_float[i] = stepper.position((AxisEnum)i) * (i == E_AXIS ? steps_to_mm[E_AXIS + active_extruder] : steps_to_mm[i]);
1422
-  #endif
1419
+  LOOP_XYZE(i) {
1420
+    position[i] = stepper.position((AxisEnum)i);
1421
+    #if ENABLED(LIN_ADVANCE)
1422
+      position_float[i] = position[i] * steps_to_mm[i
1423
+        #if ENABLED(DISTINCT_E_FACTORS)
1424
+          + (i == E_AXIS ? active_extruder : 0)
1425
+        #endif
1426
+      ];
1427
+    #endif
1428
+  }
1423 1429
 }
1424 1430
 
1425 1431
 /**

Loading…
Cancel
Save