diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index 75e0f9dcaf..4f45c4da73 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -72,16 +72,21 @@ #endif #endif +/** + * @brief Do some things before returning from G29. + * @param retry : true if the G29 can and should be retried. false if the failure is too serious. + * @param did : true if the leveling procedure completed successfully. + */ static void pre_g29_return(const bool retry, const bool did) { if (!retry) { TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_IDLE, false)); } - if (did) { - TERN_(HAS_DWIN_E3V2_BASIC, dwinLevelingDone()); - #if DISABLED(G29_RETRY_AND_RECOVER) && ENABLED(EXTENSIBLE_UI) - ExtUI::onLevelingDone(); - #endif - } + #if DISABLED(G29_RETRY_AND_RECOVER) + if (!retry || did) { + TERN_(HAS_DWIN_E3V2_BASIC, dwinLevelingDone()); + TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone()); + } + #endif } #define G29_RETURN(retry, did) do{ \