Browse Source

Use do_blocking_move_to where possible

Scott Lahteine 6 years ago
parent
commit
df44bcc5ae
2 changed files with 9 additions and 27 deletions
  1. 1
    12
      Marlin/Marlin_main.cpp
  2. 8
    15
      Marlin/ubl_G29.cpp

+ 1
- 12
Marlin/Marlin_main.cpp View File

@@ -2414,17 +2414,8 @@ static void clean_up_after_endstop_or_probe_move() {
2414 2414
       : !position_is_reachable_by_probe(rx, ry)
2415 2415
     ) return NAN;
2416 2416
 
2417
-    const float old_feedrate_mm_s = feedrate_mm_s;
2418
-
2419
-    #if ENABLED(DELTA)
2420
-      if (current_position[Z_AXIS] > delta_clip_start_height)
2421
-        do_blocking_move_to_z(delta_clip_start_height);
2422
-    #endif
2423
-
2424
-    feedrate_mm_s = XY_PROBE_FEEDRATE_MM_S;
2425
-
2426 2417
     // Move the probe to the given XY
2427
-    do_blocking_move_to_xy(nx, ny);
2418
+    do_blocking_move_to_xy(nx, ny, XY_PROBE_FEEDRATE_MM_S);
2428 2419
 
2429 2420
     float measured_z = NAN;
2430 2421
     if (!DEPLOY_PROBE()) {
@@ -2450,8 +2441,6 @@ static void clean_up_after_endstop_or_probe_move() {
2450 2441
       if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< probe_pt");
2451 2442
     #endif
2452 2443
 
2453
-    feedrate_mm_s = old_feedrate_mm_s;
2454
-
2455 2444
     if (isnan(measured_z)) {
2456 2445
       LCD_MESSAGEPGM(MSG_ERR_PROBING_FAILED);
2457 2446
       SERIAL_ERROR_START();

+ 8
- 15
Marlin/ubl_G29.cpp View File

@@ -466,6 +466,7 @@
466 466
             //
467 467
             SERIAL_PROTOCOLLNPGM("Manually probing unreachable mesh locations.");
468 468
             do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);
469
+
469 470
             if (!g29_x_flag && !g29_y_flag) {
470 471
               /**
471 472
                * Use a good default location for the path.
@@ -911,8 +912,7 @@
911 912
       has_control_of_lcd_panel = true;
912 913
       save_ubl_active_state_and_disable();   // Disable bed level correction for probing
913 914
 
914
-      do_blocking_move_to_z(in_height);
915
-      do_blocking_move_to_xy(0.5 * (MESH_MAX_X - (MESH_MIN_X)), 0.5 * (MESH_MAX_Y - (MESH_MIN_Y)));
915
+      do_blocking_move_to(0.5 * (MESH_MAX_X - (MESH_MIN_X)), 0.5 * (MESH_MAX_Y - (MESH_MIN_Y)), in_height);
916 916
         //, min(planner.max_feedrate_mm_s[X_AXIS], planner.max_feedrate_mm_s[Y_AXIS]) / 2.0);
917 917
       stepper.synchronize();
918 918
 
@@ -955,8 +955,7 @@
955 955
       has_control_of_lcd_panel = true;
956 956
 
957 957
       save_ubl_active_state_and_disable();   // we don't do bed level correction because we want the raw data when we probe
958
-      do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);
959
-      do_blocking_move_to_xy(rx, ry);
958
+      do_blocking_move_to(rx, ry, Z_CLEARANCE_BETWEEN_PROBES);
960 959
 
961 960
       lcd_return_to_status();
962 961
 
@@ -971,11 +970,9 @@
971 970
 
972 971
         if (!position_is_reachable(xProbe, yProbe)) break; // SHOULD NOT OCCUR (find_closest_mesh_point only returns reachable points)
973 972
 
974
-        do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);
975
-
976 973
         LCD_MESSAGEPGM(MSG_UBL_MOVING_TO_NEXT);
977 974
 
978
-        do_blocking_move_to_xy(xProbe, yProbe);
975
+        do_blocking_move_to(xProbe, yProbe, Z_CLEARANCE_BETWEEN_PROBES);
979 976
         do_blocking_move_to_z(z_clearance);
980 977
 
981 978
         KEEPALIVE_STATE(PAUSED_FOR_USER);
@@ -1032,8 +1029,7 @@
1032 1029
 
1033 1030
       restore_ubl_active_state_and_leave();
1034 1031
       KEEPALIVE_STATE(IN_HANDLER);
1035
-      do_blocking_move_to_z(Z_CLEARANCE_DEPLOY_PROBE);
1036
-      do_blocking_move_to_xy(rx, ry);
1032
+      do_blocking_move_to(rx, ry, Z_CLEARANCE_DEPLOY_PROBE);
1037 1033
     }
1038 1034
   #endif // NEWPANEL
1039 1035
 
@@ -1486,8 +1482,7 @@
1486 1482
 
1487 1483
       LCD_MESSAGEPGM(MSG_UBL_FINE_TUNE_MESH);
1488 1484
 
1489
-      do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);
1490
-      do_blocking_move_to_xy(rx, ry);
1485
+      do_blocking_move_to(rx, ry, Z_CLEARANCE_BETWEEN_PROBES);
1491 1486
 
1492 1487
       uint16_t not_done[16];
1493 1488
       memset(not_done, 0xFF, sizeof(not_done));
@@ -1510,8 +1505,7 @@
1510 1505
         if (isnan(new_z)) // if the mesh point is invalid, set it to 0.0 so it can be edited
1511 1506
           new_z = 0.0;
1512 1507
 
1513
-        do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);    // Move the nozzle to where we are going to edit
1514
-        do_blocking_move_to_xy(rawx, rawy);
1508
+        do_blocking_move_to(rawx, rawy, Z_CLEARANCE_BETWEEN_PROBES); // Move the nozzle to the edit point
1515 1509
 
1516 1510
         new_z = FLOOR(new_z * 1000.0) * 0.001; // Chop off digits after the 1000ths place
1517 1511
 
@@ -1571,9 +1565,8 @@
1571 1565
 
1572 1566
       if (do_ubl_mesh_map) display_map(g29_map_type);
1573 1567
       restore_ubl_active_state_and_leave();
1574
-      do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);
1575 1568
 
1576
-      do_blocking_move_to_xy(rx, ry);
1569
+      do_blocking_move_to(rx, ry, Z_CLEARANCE_BETWEEN_PROBES);
1577 1570
 
1578 1571
       LCD_MESSAGEPGM(MSG_UBL_DONE_EDITING_MESH);
1579 1572
       SERIAL_ECHOLNPGM("Done Editing Mesh");

Loading…
Cancel
Save