Fix "G29" G29_MAX_RETRIES handling

2.0.x
Scott Lahteine 7 years ago
parent 42f9921482
commit a264030526

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

Loading…
Cancel
Save