Browse Source

Fix DELTA_CALIBRATION_MENU recursive call (#16656)

Jason Smith 5 years ago
parent
commit
95d5a0c480

+ 1
- 1
Marlin/src/feature/bedlevel/bedlevel.cpp View File

247
     current_position = pos;
247
     current_position = pos;
248
 
248
 
249
     #if ENABLED(LCD_BED_LEVELING)
249
     #if ENABLED(LCD_BED_LEVELING)
250
-      ui.wait_for_bl_move = false;
250
+      ui.wait_for_move = false;
251
     #endif
251
     #endif
252
   }
252
   }
253
 
253
 

+ 2
- 2
Marlin/src/gcode/bedlevel/abl/G29.cpp View File

508
       set_bed_leveling_enabled(abl_should_enable);
508
       set_bed_leveling_enabled(abl_should_enable);
509
       g29_in_progress = false;
509
       g29_in_progress = false;
510
       #if ENABLED(LCD_BED_LEVELING)
510
       #if ENABLED(LCD_BED_LEVELING)
511
-        ui.wait_for_bl_move = false;
511
+        ui.wait_for_move = false;
512
       #endif
512
       #endif
513
     }
513
     }
514
 
514
 
810
   #if ENABLED(PROBE_MANUALLY)
810
   #if ENABLED(PROBE_MANUALLY)
811
     g29_in_progress = false;
811
     g29_in_progress = false;
812
     #if ENABLED(LCD_BED_LEVELING)
812
     #if ENABLED(LCD_BED_LEVELING)
813
-      ui.wait_for_bl_move = false;
813
+      ui.wait_for_move = false;
814
     #endif
814
     #endif
815
   #endif
815
   #endif
816
 
816
 

+ 2
- 2
Marlin/src/gcode/bedlevel/mbl/G29.cpp View File

88
     case MeshStart:
88
     case MeshStart:
89
       mbl.reset();
89
       mbl.reset();
90
       mbl_probe_index = 0;
90
       mbl_probe_index = 0;
91
-      if (!ui.wait_for_bl_move) {
91
+      if (!ui.wait_for_move) {
92
         queue.inject_P(PSTR("G28\nG29 S2"));
92
         queue.inject_P(PSTR("G28\nG29 S2"));
93
         return;
93
         return;
94
       }
94
       }
148
         #endif
148
         #endif
149
 
149
 
150
         #if ENABLED(LCD_BED_LEVELING)
150
         #if ENABLED(LCD_BED_LEVELING)
151
-          ui.wait_for_bl_move = false;
151
+          ui.wait_for_move = false;
152
         #endif
152
         #endif
153
       }
153
       }
154
       break;
154
       break;

+ 4
- 6
Marlin/src/lcd/menu/menu_bed_leveling.cpp View File

56
     #endif
56
     #endif
57
   );
57
   );
58
 
58
 
59
-  bool MarlinUI::wait_for_bl_move; // = false
60
-
61
   //
59
   //
62
   // Bed leveling is done. Wait for G29 to complete.
60
   // Bed leveling is done. Wait for G29 to complete.
63
   // A flag is used so that this can release control
61
   // A flag is used so that this can release control
70
   // ** This blocks the command queue! **
68
   // ** This blocks the command queue! **
71
   //
69
   //
72
   void _lcd_level_bed_done() {
70
   void _lcd_level_bed_done() {
73
-    if (!ui.wait_for_bl_move) {
71
+    if (!ui.wait_for_move) {
74
       #if MANUAL_PROBE_HEIGHT > 0 && DISABLED(MESH_BED_LEVELING)
72
       #if MANUAL_PROBE_HEIGHT > 0 && DISABLED(MESH_BED_LEVELING)
75
         // Display "Done" screen and wait for moves to complete
73
         // Display "Done" screen and wait for moves to complete
76
         line_to_z(MANUAL_PROBE_HEIGHT);
74
         line_to_z(MANUAL_PROBE_HEIGHT);
103
         //
101
         //
104
         // The last G29 records the point and enables bed leveling
102
         // The last G29 records the point and enables bed leveling
105
         //
103
         //
106
-        ui.wait_for_bl_move = true;
104
+        ui.wait_for_move = true;
107
         ui.goto_screen(_lcd_level_bed_done);
105
         ui.goto_screen(_lcd_level_bed_done);
108
         #if ENABLED(MESH_BED_LEVELING)
106
         #if ENABLED(MESH_BED_LEVELING)
109
           queue.inject_P(PSTR("G29 S2"));
107
           queue.inject_P(PSTR("G29 S2"));
146
       MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_LEVEL_BED_NEXT_POINT), msg);
144
       MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_LEVEL_BED_NEXT_POINT), msg);
147
     }
145
     }
148
     ui.refresh(LCDVIEW_CALL_NO_REDRAW);
146
     ui.refresh(LCDVIEW_CALL_NO_REDRAW);
149
-    if (!ui.wait_for_bl_move) ui.goto_screen(_lcd_level_bed_get_z);
147
+    if (!ui.wait_for_move) ui.goto_screen(_lcd_level_bed_get_z);
150
   }
148
   }
151
 
149
 
152
   //
150
   //
156
     ui.goto_screen(_lcd_level_bed_moving);
154
     ui.goto_screen(_lcd_level_bed_moving);
157
 
155
 
158
     // G29 Records Z, moves, and signals when it pauses
156
     // G29 Records Z, moves, and signals when it pauses
159
-    ui.wait_for_bl_move = true;
157
+    ui.wait_for_move = true;
160
     #if ENABLED(MESH_BED_LEVELING)
158
     #if ENABLED(MESH_BED_LEVELING)
161
       queue.inject_P(manual_probe_index ? PSTR("G29 S2") : PSTR("G29 S1"));
159
       queue.inject_P(manual_probe_index ? PSTR("G29 S2") : PSTR("G29 S1"));
162
     #elif ENABLED(PROBE_MANUALLY)
160
     #elif ENABLED(PROBE_MANUALLY)

+ 8
- 4
Marlin/src/lcd/menu/menu_delta_calibrate.cpp View File

41
 #endif
41
 #endif
42
 
42
 
43
 void _man_probe_pt(const xy_pos_t &xy) {
43
 void _man_probe_pt(const xy_pos_t &xy) {
44
-  do_blocking_move_to_xy_z(xy, Z_CLEARANCE_BETWEEN_PROBES);
45
-  ui.synchronize();
46
-  move_menu_scale = _MAX(PROBE_MANUALLY_STEP, MIN_STEPS_PER_SEGMENT / float(DEFAULT_XYZ_STEPS_PER_UNIT));
47
-  ui.goto_screen(lcd_move_z);
44
+  if (!ui.wait_for_move) {
45
+    ui.wait_for_move = true;
46
+    do_blocking_move_to_xy_z(xy, Z_CLEARANCE_BETWEEN_PROBES);
47
+    ui.wait_for_move = false;
48
+    ui.synchronize();
49
+    move_menu_scale = _MAX(PROBE_MANUALLY_STEP, MIN_STEPS_PER_SEGMENT / float(DEFAULT_XYZ_STEPS_PER_UNIT));
50
+    ui.goto_screen(lcd_move_z);
51
+  }
48
 }
52
 }
49
 
53
 
50
 #if ENABLED(DELTA_AUTO_CALIBRATION)
54
 #if ENABLED(DELTA_AUTO_CALIBRATION)

+ 4
- 0
Marlin/src/lcd/ultralcd.cpp View File

45
   #endif
45
   #endif
46
 #endif
46
 #endif
47
 
47
 
48
+#if LCD_HAS_WAIT_FOR_MOVE
49
+  bool MarlinUI::wait_for_move; // = false
50
+#endif
51
+
48
 #if HAS_SPI_LCD
52
 #if HAS_SPI_LCD
49
   #if ENABLED(STATUS_MESSAGE_SCROLLING)
53
   #if ENABLED(STATUS_MESSAGE_SCROLLING)
50
     uint8_t MarlinUI::status_scroll_offset; // = 0
54
     uint8_t MarlinUI::status_scroll_offset; // = 0

+ 5
- 3
Marlin/src/lcd/ultralcd.h View File

532
 
532
 
533
   #endif
533
   #endif
534
 
534
 
535
-  #if ENABLED(LCD_BED_LEVELING) && EITHER(PROBE_MANUALLY, MESH_BED_LEVELING)
536
-    static bool wait_for_bl_move;
535
+  #define LCD_HAS_WAIT_FOR_MOVE EITHER(DELTA_CALIBRATION_MENU, DELTA_AUTO_CALIBRATION) || (ENABLED(LCD_BED_LEVELING) && EITHER(PROBE_MANUALLY, MESH_BED_LEVELING))
536
+
537
+  #if LCD_HAS_WAIT_FOR_MOVE
538
+    static bool wait_for_move;
537
   #else
539
   #else
538
-    static constexpr bool wait_for_bl_move = false;
540
+    static constexpr bool wait_for_move = false;
539
   #endif
541
   #endif
540
 
542
 
541
   #if HAS_LCD_MENU && EITHER(AUTO_BED_LEVELING_UBL, G26_MESH_VALIDATION)
543
   #if HAS_LCD_MENU && EITHER(AUTO_BED_LEVELING_UBL, G26_MESH_VALIDATION)

Loading…
Cancel
Save