@ -241,8 +241,8 @@ void GcodeSuite::G28() {
// Disable the leveling matrix before homing
// Disable the leveling matrix before homing
# if HAS_LEVELING
# if HAS_LEVELING
const bool leveling_restore_state = ENABLED ( ENABLE_LEVELING_AFTER_G28 ) | | TERN0 ( RESTORE_LEVELING_AFTER_G28 , planner . leveling_active ) ;
IF_ENABLED ( RESTORE_LEVELING_AFTER_G28 , const bool leveling_restore_state = planner . leveling_active ) ;
TERN_ ( PROBE_MANUALLY , g29_in_progress = false ) ; // Cancel the active G29 session
IF_ENABLED ( PROBE_MANUALLY , g29_in_progress = false ) ; // Cancel the active G29 session
set_bed_leveling_enabled ( false ) ;
set_bed_leveling_enabled ( false ) ;
# endif
# endif
@ -435,7 +435,8 @@ void GcodeSuite::G28() {
do_blocking_move_to_z ( delta_clip_start_height ) ;
do_blocking_move_to_z ( delta_clip_start_height ) ;
# endif
# endif
TERN_ ( RESTORE_LEVELING_AFTER_G28 , set_bed_leveling_enabled ( leveling_restore_state ) ) ;
IF_ENABLED ( RESTORE_LEVELING_AFTER_G28 , set_bed_leveling_enabled ( leveling_restore_state ) ) ;
IF_ENABLED ( ENABLE_LEVELING_AFTER_G28 , set_bed_leveling_enabled ( true ) ) ;
restore_feedrate_and_scaling ( ) ;
restore_feedrate_and_scaling ( ) ;