Browse Source

Fix G28 leveling state, UBL compile (#20499)

Tanguy Pruvot 4 years ago
parent
commit
c559fc8227
No account linked to committer's email address

+ 4
- 3
Marlin/src/gcode/calibrate/G28.cpp View File

@@ -241,8 +241,8 @@ void GcodeSuite::G28() {
241 241
 
242 242
   // Disable the leveling matrix before homing
243 243
   #if HAS_LEVELING
244
-    const bool leveling_restore_state = ENABLED(ENABLE_LEVELING_AFTER_G28) || TERN0(RESTORE_LEVELING_AFTER_G28, planner.leveling_active);
245
-    TERN_(PROBE_MANUALLY, g29_in_progress = false);  // Cancel the active G29 session
244
+    IF_ENABLED(RESTORE_LEVELING_AFTER_G28, const bool leveling_restore_state = planner.leveling_active);
245
+    IF_ENABLED(PROBE_MANUALLY, g29_in_progress = false); // Cancel the active G29 session
246 246
     set_bed_leveling_enabled(false);
247 247
   #endif
248 248
 
@@ -435,7 +435,8 @@ void GcodeSuite::G28() {
435 435
     do_blocking_move_to_z(delta_clip_start_height);
436 436
   #endif
437 437
 
438
-  TERN_(RESTORE_LEVELING_AFTER_G28, set_bed_leveling_enabled(leveling_restore_state));
438
+  IF_ENABLED(RESTORE_LEVELING_AFTER_G28, set_bed_leveling_enabled(leveling_restore_state));
439
+  IF_ENABLED(ENABLE_LEVELING_AFTER_G28, set_bed_leveling_enabled(true));
439 440
 
440 441
   restore_feedrate_and_scaling();
441 442
 

+ 1
- 0
Marlin/src/inc/Conditionals_LCD.h View File

@@ -886,6 +886,7 @@
886 886
 #if !HAS_LEVELING
887 887
   #undef PROBE_MANUALLY
888 888
   #undef RESTORE_LEVELING_AFTER_G28
889
+  #undef ENABLE_LEVELING_AFTER_G28
889 890
 #endif
890 891
 
891 892
 #ifdef GRID_MAX_POINTS_X

+ 0
- 2
Marlin/src/inc/SanityCheck.h View File

@@ -1455,8 +1455,6 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
1455 1455
     #error "AUTO_BED_LEVELING_UBL requires EEPROM_SETTINGS."
1456 1456
   #elif !WITHIN(GRID_MAX_POINTS_X, 3, 15) || !WITHIN(GRID_MAX_POINTS_Y, 3, 15)
1457 1457
     #error "GRID_MAX_POINTS_[XY] must be a whole number between 3 and 15."
1458
-  #elif !defined(RESTORE_LEVELING_AFTER_G28) && !defined(ENABLE_LEVELING_AFTER_G28)
1459
-    #error "AUTO_BED_LEVELING_UBL used to enable RESTORE_LEVELING_AFTER_G28. To keep this behavior enable RESTORE_LEVELING_AFTER_G28. Otherwise define it as 'false'."
1460 1458
   #endif
1461 1459
 
1462 1460
 #elif HAS_ABL_NOT_UBL

Loading…
Cancel
Save