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
 
241
 
242
   // Disable the leveling matrix before homing
242
   // Disable the leveling matrix before homing
243
   #if HAS_LEVELING
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
     set_bed_leveling_enabled(false);
246
     set_bed_leveling_enabled(false);
247
   #endif
247
   #endif
248
 
248
 
435
     do_blocking_move_to_z(delta_clip_start_height);
435
     do_blocking_move_to_z(delta_clip_start_height);
436
   #endif
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
   restore_feedrate_and_scaling();
441
   restore_feedrate_and_scaling();
441
 
442
 

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

886
 #if !HAS_LEVELING
886
 #if !HAS_LEVELING
887
   #undef PROBE_MANUALLY
887
   #undef PROBE_MANUALLY
888
   #undef RESTORE_LEVELING_AFTER_G28
888
   #undef RESTORE_LEVELING_AFTER_G28
889
+  #undef ENABLE_LEVELING_AFTER_G28
889
 #endif
890
 #endif
890
 
891
 
891
 #ifdef GRID_MAX_POINTS_X
892
 #ifdef GRID_MAX_POINTS_X

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

1455
     #error "AUTO_BED_LEVELING_UBL requires EEPROM_SETTINGS."
1455
     #error "AUTO_BED_LEVELING_UBL requires EEPROM_SETTINGS."
1456
   #elif !WITHIN(GRID_MAX_POINTS_X, 3, 15) || !WITHIN(GRID_MAX_POINTS_Y, 3, 15)
1456
   #elif !WITHIN(GRID_MAX_POINTS_X, 3, 15) || !WITHIN(GRID_MAX_POINTS_Y, 3, 15)
1457
     #error "GRID_MAX_POINTS_[XY] must be a whole number between 3 and 15."
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
   #endif
1458
   #endif
1461
 
1459
 
1462
 #elif HAS_ABL_NOT_UBL
1460
 #elif HAS_ABL_NOT_UBL

Loading…
Cancel
Save