Browse Source

Patch G29 no_action for A and Q

Scott Lahteine 7 years ago
parent
commit
e5ca60acf5
1 changed files with 20 additions and 12 deletions
  1. 20
    12
      Marlin/src/gcode/bedlevel/abl/G29.cpp

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

132
  */
132
  */
133
 void GcodeSuite::G29() {
133
 void GcodeSuite::G29() {
134
 
134
 
135
+  #if ENABLED(DEBUG_LEVELING_FEATURE) || ENABLED(PROBE_MANUALLY)
136
+    const bool seenQ = parser.seen('Q');
137
+  #else
138
+    constexpr bool seenQ = false;
139
+  #endif
140
+
135
   // G29 Q is also available if debugging
141
   // G29 Q is also available if debugging
136
   #if ENABLED(DEBUG_LEVELING_FEATURE)
142
   #if ENABLED(DEBUG_LEVELING_FEATURE)
137
-    const bool query = parser.seen('Q');
138
     const uint8_t old_debug_flags = marlin_debug_flags;
143
     const uint8_t old_debug_flags = marlin_debug_flags;
139
-    if (query) marlin_debug_flags |= DEBUG_LEVELING;
144
+    if (seenQ) marlin_debug_flags |= DEBUG_LEVELING;
140
     if (DEBUGGING(LEVELING)) {
145
     if (DEBUGGING(LEVELING)) {
141
       DEBUG_POS(">>> G29", current_position);
146
       DEBUG_POS(">>> G29", current_position);
142
       log_machine_info();
147
       log_machine_info();
143
     }
148
     }
144
     marlin_debug_flags = old_debug_flags;
149
     marlin_debug_flags = old_debug_flags;
145
     #if DISABLED(PROBE_MANUALLY)
150
     #if DISABLED(PROBE_MANUALLY)
146
-      if (query) return;
151
+      if (seenQ) return;
147
     #endif
152
     #endif
148
   #endif
153
   #endif
149
 
154
 
150
   #if ENABLED(PROBE_MANUALLY)
155
   #if ENABLED(PROBE_MANUALLY)
151
-    const bool seenA = parser.seen('A'), seenQ = parser.seen('Q'), no_action = seenA || seenQ;
152
-  #endif
153
-
154
-  #if ENABLED(DEBUG_LEVELING_FEATURE) && DISABLED(PROBE_MANUALLY)
155
-    const bool faux = parser.boolval('C');
156
-  #elif ENABLED(PROBE_MANUALLY)
157
-    const bool faux = no_action;
156
+    const bool seenA = parser.seen('A');
158
   #else
157
   #else
159
-    bool constexpr faux = false;
158
+    constexpr bool seenA = false;
160
   #endif
159
   #endif
161
 
160
 
161
+  const bool  no_action = seenA || seenQ,
162
+              faux =
163
+                #if ENABLED(DEBUG_LEVELING_FEATURE) && DISABLED(PROBE_MANUALLY)
164
+                  parser.boolval('C')
165
+                #else
166
+                  no_action
167
+                #endif
168
+              ;
169
+
162
   // Don't allow auto-leveling without homing first
170
   // Don't allow auto-leveling without homing first
163
   if (axis_unhomed_error()) return;
171
   if (axis_unhomed_error()) return;
164
 
172
 
388
 
396
 
389
     // Disable auto bed leveling during G29.
397
     // Disable auto bed leveling during G29.
390
     // Be formal so G29 can be done successively without G28.
398
     // Be formal so G29 can be done successively without G28.
391
-    set_bed_leveling_enabled(false);
399
+    if (!no_action) set_bed_leveling_enabled(false);
392
 
400
 
393
     #if HAS_BED_PROBE
401
     #if HAS_BED_PROBE
394
       // Deploy the probe. Probe will raise if needed.
402
       // Deploy the probe. Probe will raise if needed.

Loading…
Cancel
Save