Selaa lähdekoodia

Minor cleanup of M48

Scott Lahteine 10 vuotta sitten
vanhempi
commit
182f2cda35
1 muutettua tiedostoa jossa 11 lisäystä ja 14 poistoa
  1. 11
    14
      Marlin/Marlin_main.cpp

+ 11
- 14
Marlin/Marlin_main.cpp Näytä tiedosto

@@ -1189,8 +1189,8 @@ inline void set_destination_to_current() { memcpy(destination, current_position,
1189 1189
       st_synchronize();
1190 1190
       endstops_hit_on_purpose(); // clear endstop hit flags
1191 1191
 
1192
+      // Get the current stepper position after bumping an endstop
1192 1193
       current_position[Z_AXIS] = st_get_position_mm(Z_AXIS);
1193
-      // make sure the planner knows where we are as it may be a bit different than we last said to move to
1194 1194
       sync_plan_position();
1195 1195
       
1196 1196
     #endif // !DELTA
@@ -2908,12 +2908,12 @@ inline void gcode_M42() {
2908 2908
       }
2909 2909
     }
2910 2910
 
2911
-    double X_probe_location, Y_probe_location,
2912
-           X_current = X_probe_location = st_get_position_mm(X_AXIS),
2913
-           Y_current = Y_probe_location = st_get_position_mm(Y_AXIS),
2911
+    double X_current = st_get_position_mm(X_AXIS),
2912
+           Y_current = st_get_position_mm(Y_AXIS),
2914 2913
            Z_current = st_get_position_mm(Z_AXIS),
2915
-           Z_start_location = Z_current + Z_RAISE_BEFORE_PROBING,
2916
-           ext_position = st_get_position_mm(E_AXIS);
2914
+           E_current = st_get_position_mm(E_AXIS),
2915
+           X_probe_location = X_current, Y_probe_location = Y_current,
2916
+           Z_start_location = Z_current + Z_RAISE_BEFORE_PROBING;
2917 2917
 
2918 2918
     bool deploy_probe_for_each_reading = code_seen('E') || code_seen('e');
2919 2919
 
@@ -2948,10 +2948,7 @@ inline void gcode_M42() {
2948 2948
 
2949 2949
     st_synchronize();
2950 2950
     plan_bed_level_matrix.set_to_identity();
2951
-    plan_buffer_line(X_current, Y_current, Z_start_location,
2952
-        ext_position,
2953
-        homing_feedrate[Z_AXIS] / 60,
2954
-        active_extruder);
2951
+    plan_buffer_line(X_current, Y_current, Z_start_location, E_current, homing_feedrate[Z_AXIS] / 60, active_extruder);
2955 2952
     st_synchronize();
2956 2953
 
2957 2954
     //
@@ -2963,7 +2960,7 @@ inline void gcode_M42() {
2963 2960
       SERIAL_PROTOCOLPGM("Positioning the probe...\n");
2964 2961
 
2965 2962
     plan_buffer_line( X_probe_location, Y_probe_location, Z_start_location,
2966
-        ext_position,
2963
+        E_current,
2967 2964
         homing_feedrate[X_AXIS]/60,
2968 2965
         active_extruder);
2969 2966
     st_synchronize();
@@ -2971,7 +2968,7 @@ inline void gcode_M42() {
2971 2968
     current_position[X_AXIS] = X_current = st_get_position_mm(X_AXIS);
2972 2969
     current_position[Y_AXIS] = Y_current = st_get_position_mm(Y_AXIS);
2973 2970
     current_position[Z_AXIS] = Z_current = st_get_position_mm(Z_AXIS);
2974
-    current_position[E_AXIS] = ext_position = st_get_position_mm(E_AXIS);
2971
+    current_position[E_AXIS] = E_current = st_get_position_mm(E_AXIS);
2975 2972
 
2976 2973
     // 
2977 2974
     // OK, do the inital probe to get us close to the bed.
@@ -2987,7 +2984,7 @@ inline void gcode_M42() {
2987 2984
     Z_start_location = st_get_position_mm(Z_AXIS) + Z_RAISE_BEFORE_PROBING;
2988 2985
 
2989 2986
     plan_buffer_line( X_probe_location, Y_probe_location, Z_start_location,
2990
-        ext_position,
2987
+        E_current,
2991 2988
         homing_feedrate[X_AXIS]/60,
2992 2989
         active_extruder);
2993 2990
     st_synchronize();
@@ -3017,8 +3014,8 @@ inline void gcode_M42() {
3017 3014
           if (radius < 0.0) radius = -radius;
3018 3015
 
3019 3016
           X_current = X_probe_location + cos(theta) * radius;
3020
-          Y_current = Y_probe_location + sin(theta) * radius;
3021 3017
           X_current = constrain(X_current, X_MIN_POS, X_MAX_POS);
3018
+          Y_current = Y_probe_location + sin(theta) * radius;
3022 3019
           Y_current = constrain(Y_current, Y_MIN_POS, Y_MAX_POS);
3023 3020
 
3024 3021
           if (verbose_level > 3) {

Loading…
Peruuta
Tallenna