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,7 +247,7 @@ void reset_bed_level() {
247 247
     current_position = pos;
248 248
 
249 249
     #if ENABLED(LCD_BED_LEVELING)
250
-      ui.wait_for_bl_move = false;
250
+      ui.wait_for_move = false;
251 251
     #endif
252 252
   }
253 253
 

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

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

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

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

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

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

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

@@ -41,10 +41,14 @@
41 41
 #endif
42 42
 
43 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 54
 #if ENABLED(DELTA_AUTO_CALIBRATION)

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

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

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

@@ -532,10 +532,12 @@ public:
532 532
 
533 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 539
   #else
538
-    static constexpr bool wait_for_bl_move = false;
540
+    static constexpr bool wait_for_move = false;
539 541
   #endif
540 542
 
541 543
   #if HAS_LCD_MENU && EITHER(AUTO_BED_LEVELING_UBL, G26_MESH_VALIDATION)

Loading…
Cancel
Save