소스 검색

Move sync_plan_position closer to the top

Scott Lahteine 9 년 전
부모
커밋
db5df9500b
1개의 변경된 파일14개의 추가작업 그리고 13개의 파일을 삭제
  1. 14
    13
      Marlin/Marlin_main.cpp

+ 14
- 13
Marlin/Marlin_main.cpp 파일 보기

@@ -610,6 +610,20 @@ static void report_current_position();
610 610
     print_xyz(PSTR(STRINGIFY(VAR) "="), PSTR(" : " SUFFIX "\n"), VAR); } while(0)
611 611
 #endif
612 612
 
613
+/**
614
+ * sync_plan_position
615
+ * Set planner / stepper positions to the cartesian current_position.
616
+ * The stepper code translates these coordinates into step units.
617
+ * Allows translation between steps and millimeters for cartesian & core robots
618
+ */
619
+inline void sync_plan_position() {
620
+  #if ENABLED(DEBUG_LEVELING_FEATURE)
621
+    if (DEBUGGING(LEVELING)) DEBUG_POS("sync_plan_position", current_position);
622
+  #endif
623
+  planner.set_position_mm(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
624
+}
625
+inline void sync_plan_position_e() { planner.set_e_position_mm(current_position[E_AXIS]); }
626
+
613 627
 #if ENABLED(DELTA) || ENABLED(SCARA)
614 628
   inline void sync_plan_position_delta() {
615 629
     #if ENABLED(DEBUG_LEVELING_FEATURE)
@@ -1627,19 +1641,6 @@ inline void line_to_destination(float fr_mm_m) {
1627 1641
 }
1628 1642
 inline void line_to_destination() { line_to_destination(feedrate_mm_m); }
1629 1643
 
1630
-/**
1631
- * sync_plan_position
1632
- * Set planner / stepper positions to the cartesian current_position.
1633
- * The stepper code translates these coordinates into step units.
1634
- * Allows translation between steps and millimeters for cartesian & core robots
1635
- */
1636
-inline void sync_plan_position() {
1637
-  #if ENABLED(DEBUG_LEVELING_FEATURE)
1638
-    if (DEBUGGING(LEVELING)) DEBUG_POS("sync_plan_position", current_position);
1639
-  #endif
1640
-  planner.set_position_mm(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
1641
-}
1642
-inline void sync_plan_position_e() { planner.set_e_position_mm(current_position[E_AXIS]); }
1643 1644
 inline void set_current_to_destination() { memcpy(current_position, destination, sizeof(current_position)); }
1644 1645
 inline void set_destination_to_current() { memcpy(destination, current_position, sizeof(destination)); }
1645 1646
 

Loading…
취소
저장