Sfoglia il codice sorgente

line_to_axis_pos => do_homing_move

Scott Lahteine 8 anni fa
parent
commit
ead333e7da
1 ha cambiato i file con 14 aggiunte e 14 eliminazioni
  1. 14
    14
      Marlin/Marlin_main.cpp

+ 14
- 14
Marlin/Marlin_main.cpp Vedi File

@@ -1638,15 +1638,6 @@ inline void line_to_z(float zPosition) {
1638 1638
   planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS], feedrate_mm_s, active_extruder);
1639 1639
 }
1640 1640
 
1641
-inline void line_to_axis_pos(AxisEnum axis, float where, float fr_mm_s = 0.0) {
1642
-  float old_feedrate_mm_s = feedrate_mm_s;
1643
-  current_position[axis] = where;
1644
-  feedrate_mm_s = (fr_mm_s != 0.0) ? fr_mm_s : homing_feedrate_mm_s[axis];
1645
-  planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], feedrate_mm_s, active_extruder);
1646
-  stepper.synchronize();
1647
-  feedrate_mm_s = old_feedrate_mm_s;
1648
-}
1649
-
1650 1641
 //
1651 1642
 // line_to_destination
1652 1643
 // Move the planner, not necessarily synced with current_position
@@ -2415,6 +2406,15 @@ static void clean_up_after_endstop_or_probe_move() {
2415 2406
  * Home an individual axis
2416 2407
  */
2417 2408
 
2409
+static void do_homing_move(AxisEnum axis, float where, float fr_mm_s = 0.0) {
2410
+  float old_feedrate_mm_s = feedrate_mm_s;
2411
+  current_position[axis] = where;
2412
+  feedrate_mm_s = (fr_mm_s != 0.0) ? fr_mm_s : homing_feedrate_mm_s[axis];
2413
+  planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], feedrate_mm_s, active_extruder);
2414
+  stepper.synchronize();
2415
+  feedrate_mm_s = old_feedrate_mm_s;
2416
+}
2417
+
2418 2418
 #define HOMEAXIS(LETTER) homeaxis(LETTER##_AXIS)
2419 2419
 
2420 2420
 static void homeaxis(AxisEnum axis) {
@@ -2456,17 +2456,17 @@ static void homeaxis(AxisEnum axis) {
2456 2456
   #endif
2457 2457
 
2458 2458
   // Move towards the endstop until an endstop is triggered
2459
-  line_to_axis_pos(axis, 1.5 * max_length(axis) * axis_home_dir);
2459
+  do_homing_move(axis, 1.5 * max_length(axis) * axis_home_dir);
2460 2460
 
2461 2461
   // Set the axis position as setup for the move
2462 2462
   current_position[axis] = 0;
2463 2463
   sync_plan_position();
2464 2464
 
2465 2465
   // Move away from the endstop by the axis HOME_BUMP_MM
2466
-  line_to_axis_pos(axis, -home_bump_mm(axis) * axis_home_dir);
2466
+  do_homing_move(axis, -home_bump_mm(axis) * axis_home_dir);
2467 2467
 
2468 2468
   // Move slowly towards the endstop until triggered
2469
-  line_to_axis_pos(axis, 2 * home_bump_mm(axis) * axis_home_dir, get_homing_bump_feedrate(axis));
2469
+  do_homing_move(axis, 2 * home_bump_mm(axis) * axis_home_dir, get_homing_bump_feedrate(axis));
2470 2470
 
2471 2471
   // reset current_position to 0 to reflect hitting endpoint
2472 2472
   current_position[axis] = 0;
@@ -2490,7 +2490,7 @@ static void homeaxis(AxisEnum axis) {
2490 2490
       if (lockZ1) stepper.set_z_lock(true); else stepper.set_z2_lock(true);
2491 2491
 
2492 2492
       // Move to the adjusted endstop height
2493
-      line_to_axis_pos(axis, adj);
2493
+      do_homing_move(axis, adj);
2494 2494
 
2495 2495
       if (lockZ1) stepper.set_z_lock(false); else stepper.set_z2_lock(false);
2496 2496
       stepper.set_homing_flag(false);
@@ -2506,7 +2506,7 @@ static void homeaxis(AxisEnum axis) {
2506 2506
           DEBUG_POS("", current_position);
2507 2507
         }
2508 2508
       #endif
2509
-      line_to_axis_pos(axis, endstop_adj[axis]);
2509
+      do_homing_move(axis, endstop_adj[axis]);
2510 2510
     }
2511 2511
   #endif
2512 2512
 

Loading…
Annulla
Salva