Browse Source

Fix "G29" G29_MAX_RETRIES handling

Scott Lahteine 7 years ago
parent
commit
a264030526
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      Marlin/src/gcode/gcode.cpp

+ 2
- 2
Marlin/src/gcode/gcode.cpp View File

@@ -138,9 +138,9 @@ void GcodeSuite::dwell(millis_t time) {
138 138
 
139 139
   void GcodeSuite::G29_with_retry() {
140 140
     set_bed_leveling_enabled(false);
141
-    for (uint8_t i = G29_MAX_RETRIES; i--;) {
141
+    for (uint8_t retries_left = G29_MAX_RETRIES;;) {
142 142
       G29();
143
-      if (planner.leveling_active) break;
143
+      if (planner.leveling_active || !retries_left--) break;
144 144
       #ifdef G29_ACTION_ON_RECOVER
145 145
         SERIAL_ECHOLNPGM("//action:" G29_ACTION_ON_RECOVER);
146 146
       #endif

Loading…
Cancel
Save