Browse Source

MBL fiddle

Scott Lahteine 8 years ago
parent
commit
6cac0f43eb
1 changed files with 9 additions and 9 deletions
  1. 9
    9
      Marlin/Marlin_main.cpp

+ 9
- 9
Marlin/Marlin_main.cpp View File

@@ -3784,7 +3784,7 @@ inline void gcode_G28() {
3784 3784
    */
3785 3785
   inline void gcode_G29() {
3786 3786
 
3787
-    static int probe_index = -1;
3787
+    static int mbl_probe_index = -1;
3788 3788
     #if HAS_SOFTWARE_ENDSTOPS
3789 3789
       static bool enable_soft_endstops;
3790 3790
     #endif
@@ -3809,17 +3809,17 @@ inline void gcode_G28() {
3809 3809
 
3810 3810
       case MeshStart:
3811 3811
         mbl.reset();
3812
-        probe_index = 0;
3812
+        mbl_probe_index = 0;
3813 3813
         enqueue_and_echo_commands_P(PSTR("G28\nG29 S2"));
3814 3814
         break;
3815 3815
 
3816 3816
       case MeshNext:
3817
-        if (probe_index < 0) {
3817
+        if (mbl_probe_index < 0) {
3818 3818
           SERIAL_PROTOCOLLNPGM("Start mesh probing with \"G29 S1\" first.");
3819 3819
           return;
3820 3820
         }
3821 3821
         // For each G29 S2...
3822
-        if (probe_index == 0) {
3822
+        if (mbl_probe_index == 0) {
3823 3823
           #if HAS_SOFTWARE_ENDSTOPS
3824 3824
             // For the initial G29 S2 save software endstop state
3825 3825
             enable_soft_endstops = soft_endstops_enabled;
@@ -3827,14 +3827,14 @@ inline void gcode_G28() {
3827 3827
         }
3828 3828
         else {
3829 3829
           // For G29 S2 after adjusting Z.
3830
-          mbl.set_zigzag_z(probe_index - 1, current_position[Z_AXIS]);
3830
+          mbl.set_zigzag_z(mbl_probe_index - 1, current_position[Z_AXIS]);
3831 3831
           #if HAS_SOFTWARE_ENDSTOPS
3832 3832
             soft_endstops_enabled = enable_soft_endstops;
3833 3833
           #endif
3834 3834
         }
3835 3835
         // If there's another point to sample, move there with optional lift.
3836
-        if (probe_index < (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS)) {
3837
-          mbl.zigzag(probe_index, px, py);
3836
+        if (mbl_probe_index < (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS)) {
3837
+          mbl.zigzag(mbl_probe_index, px, py);
3838 3838
           _mbl_goto_xy(mbl.index_to_xpos[px], mbl.index_to_ypos[py]);
3839 3839
 
3840 3840
           #if HAS_SOFTWARE_ENDSTOPS
@@ -3843,7 +3843,7 @@ inline void gcode_G28() {
3843 3843
             soft_endstops_enabled = false;
3844 3844
           #endif
3845 3845
 
3846
-          probe_index++;
3846
+          mbl_probe_index++;
3847 3847
         }
3848 3848
         else {
3849 3849
           // One last "return to the bed" (as originally coded) at completion
@@ -3853,7 +3853,7 @@ inline void gcode_G28() {
3853 3853
 
3854 3854
           // After recording the last point, activate the mbl and home
3855 3855
           SERIAL_PROTOCOLLNPGM("Mesh probing done.");
3856
-          probe_index = -1;
3856
+          mbl_probe_index = -1;
3857 3857
           mbl.set_has_mesh(true);
3858 3858
           mbl.set_reactivate(true);
3859 3859
           enqueue_and_echo_commands_P(PSTR("G28"));

Loading…
Cancel
Save