浏览代码

Always enable leveling after G28

Scott Lahteine 4 年前
父节点
当前提交
80bde7b6b5
共有 3 个文件被更改,包括 10 次插入4 次删除
  1. 4
    2
      Marlin/Configuration.h
  2. 1
    1
      Marlin/src/gcode/calibrate/G28.cpp
  3. 5
    1
      Marlin/src/inc/SanityCheck.h

+ 4
- 2
Marlin/Configuration.h 查看文件

1284
 //#define MESH_BED_LEVELING
1284
 //#define MESH_BED_LEVELING
1285
 
1285
 
1286
 /**
1286
 /**
1287
- * Normally G28 leaves leveling disabled on completion. Enable
1288
- * this option to have G28 restore the prior leveling state.
1287
+ * Normally G28 leaves leveling disabled on completion. Enable one of
1288
+ * these options to restore the prior leveling state or to always enable
1289
+ * leveling immediately after G28.
1289
  */
1290
  */
1290
 //#define RESTORE_LEVELING_AFTER_G28
1291
 //#define RESTORE_LEVELING_AFTER_G28
1292
+//#define ENABLE_LEVELING_AFTER_G28
1291
 
1293
 
1292
 /**
1294
 /**
1293
  * Auto-leveling needs preheating
1295
  * Auto-leveling needs preheating

+ 1
- 1
Marlin/src/gcode/calibrate/G28.cpp 查看文件

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
-    TERN_(RESTORE_LEVELING_AFTER_G28, const bool leveling_was_active = planner.leveling_active);
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
245
     TERN_(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

+ 5
- 1
Marlin/src/inc/SanityCheck.h 查看文件

1445
     #error "AUTO_BED_LEVELING_UBL requires EEPROM_SETTINGS."
1445
     #error "AUTO_BED_LEVELING_UBL requires EEPROM_SETTINGS."
1446
   #elif !WITHIN(GRID_MAX_POINTS_X, 3, 15) || !WITHIN(GRID_MAX_POINTS_Y, 3, 15)
1446
   #elif !WITHIN(GRID_MAX_POINTS_X, 3, 15) || !WITHIN(GRID_MAX_POINTS_Y, 3, 15)
1447
     #error "GRID_MAX_POINTS_[XY] must be a whole number between 3 and 15."
1447
     #error "GRID_MAX_POINTS_[XY] must be a whole number between 3 and 15."
1448
-  #elif !defined(RESTORE_LEVELING_AFTER_G28)
1448
+  #elif !defined(RESTORE_LEVELING_AFTER_G28) && !defined(ENABLE_LEVELING_AFTER_G28)
1449
     #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'."
1449
     #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'."
1450
   #endif
1450
   #endif
1451
 
1451
 
1473
 
1473
 
1474
 #endif
1474
 #endif
1475
 
1475
 
1476
+#if ALL(HAS_LEVELING, RESTORE_LEVELING_AFTER_G28, ENABLE_LEVELING_AFTER_G28)
1477
+  #error "Only enable RESTORE_LEVELING_AFTER_G28 or ENABLE_LEVELING_AFTER_G28, but not both."
1478
+#endif
1479
+
1476
 #if HAS_MESH && HAS_CLASSIC_JERK
1480
 #if HAS_MESH && HAS_CLASSIC_JERK
1477
   static_assert(DEFAULT_ZJERK > 0.1, "Low DEFAULT_ZJERK values are incompatible with mesh-based leveling.");
1481
   static_assert(DEFAULT_ZJERK > 0.1, "Low DEFAULT_ZJERK values are incompatible with mesh-based leveling.");
1478
 #endif
1482
 #endif

正在加载...
取消
保存