Przeglądaj źródła

Don't report point 0 in MBL G29

Scott Lahteine 7 lat temu
rodzic
commit
65a6a86d19
1 zmienionych plików z 8 dodań i 5 usunięć
  1. 8
    5
      Marlin/src/gcode/bedlevel/mbl/G29.cpp

+ 8
- 5
Marlin/src/gcode/bedlevel/mbl/G29.cpp Wyświetl plik

69
     static bool enable_soft_endstops;
69
     static bool enable_soft_endstops;
70
   #endif
70
   #endif
71
 
71
 
72
-  const MeshLevelingState state = (MeshLevelingState)parser.byteval('S', (int8_t)MeshReport);
72
+  MeshLevelingState state = (MeshLevelingState)parser.byteval('S', (int8_t)MeshReport);
73
   if (!WITHIN(state, 0, 5)) {
73
   if (!WITHIN(state, 0, 5)) {
74
     SERIAL_PROTOCOLLNPGM("S out of range (0-5).");
74
     SERIAL_PROTOCOLLNPGM("S out of range (0-5).");
75
     return;
75
     return;
90
     case MeshStart:
90
     case MeshStart:
91
       mbl.reset();
91
       mbl.reset();
92
       mbl_probe_index = 0;
92
       mbl_probe_index = 0;
93
-      enqueue_and_echo_commands_P(lcd_wait_for_move ? PSTR("G29 S2") : PSTR("G28\nG29 S2"));
94
-      break;
93
+      if (!lcd_wait_for_move) {
94
+        enqueue_and_echo_commands_P(PSTR("G28\nG29 S2"));
95
+        return;
96
+      }
97
+      state = MeshNext;
95
 
98
 
96
     case MeshNext:
99
     case MeshNext:
97
       if (mbl_probe_index < 0) {
100
       if (mbl_probe_index < 0) {
108
         do_blocking_move_to_z(0);
111
         do_blocking_move_to_z(0);
109
       }
112
       }
110
       else {
113
       else {
111
-        // For G29 S2 after adjusting Z.
114
+        // Save Z for the previous mesh position
112
         mbl.set_zigzag_z(mbl_probe_index - 1, current_position[Z_AXIS]);
115
         mbl.set_zigzag_z(mbl_probe_index - 1, current_position[Z_AXIS]);
113
         #if HAS_SOFTWARE_ENDSTOPS
116
         #if HAS_SOFTWARE_ENDSTOPS
114
           soft_endstops_enabled = enable_soft_endstops;
117
           soft_endstops_enabled = enable_soft_endstops;
201
 
204
 
202
   } // switch(state)
205
   } // switch(state)
203
 
206
 
204
-  if (state == MeshStart || state == MeshNext) {
207
+  if (state == MeshNext) {
205
     SERIAL_PROTOCOLPAIR("MBL G29 point ", min(mbl_probe_index, GRID_MAX_POINTS));
208
     SERIAL_PROTOCOLPAIR("MBL G29 point ", min(mbl_probe_index, GRID_MAX_POINTS));
206
     SERIAL_PROTOCOLLNPAIR(" of ", int(GRID_MAX_POINTS));
209
     SERIAL_PROTOCOLLNPAIR(" of ", int(GRID_MAX_POINTS));
207
   }
210
   }

Ładowanie…
Anuluj
Zapisz