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

Loading…
Cancel
Save