瀏覽代碼

Adjust leveling conditionals

Scott Lahteine 7 年之前
父節點
當前提交
ed81e9b3d3
共有 6 個檔案被更改,包括 24 行新增25 行删除
  1. 3
    4
      Marlin/Conditionals_post.h
  2. 1
    1
      Marlin/Marlin.h
  3. 12
    12
      Marlin/Marlin_main.cpp
  4. 1
    1
      Marlin/configuration_store.cpp
  5. 3
    3
      Marlin/planner.cpp
  6. 4
    4
      Marlin/planner.h

+ 3
- 4
Marlin/Conditionals_post.h 查看文件

@@ -718,15 +718,14 @@
718 718
   #endif
719 719
 
720 720
   /**
721
-   * Set ABL options based on the specific type of leveling
721
+   * Set granular options based on the specific type of leveling
722 722
    */
723 723
   #define ABL_PLANAR (ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_3POINT))
724 724
   #define ABL_GRID   (ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR))
725 725
   #define HAS_ABL    (ABL_PLANAR || ABL_GRID || ENABLED(AUTO_BED_LEVELING_UBL))
726
-
727
-  #define PLANNER_LEVELING      (HAS_ABL || ENABLED(MESH_BED_LEVELING))
726
+  #define HAS_LEVELING          (HAS_ABL || ENABLED(MESH_BED_LEVELING))
727
+  #define PLANNER_LEVELING      (ABL_PLANAR || ABL_GRID || ENABLED(MESH_BED_LEVELING))
728 728
   #define HAS_PROBING_PROCEDURE (HAS_ABL || ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST))
729
-
730 729
   #if HAS_PROBING_PROCEDURE
731 730
     #define PROBE_BED_WIDTH abs(RIGHT_PROBE_BED_POSITION - (LEFT_PROBE_BED_POSITION))
732 731
     #define PROBE_BED_HEIGHT abs(BACK_PROBE_BED_POSITION - (FRONT_PROBE_BED_POSITION))

+ 1
- 1
Marlin/Marlin.h 查看文件

@@ -324,7 +324,7 @@ float code_value_temp_diff();
324 324
   linear_fit* lsf_linear_fit(double x[], double y[], double z[], const int);
325 325
 #endif
326 326
 
327
-#if PLANNER_LEVELING
327
+#if HAS_LEVELING
328 328
   void reset_bed_level();
329 329
 #endif
330 330
 

+ 12
- 12
Marlin/Marlin_main.cpp 查看文件

@@ -2403,7 +2403,7 @@ static void clean_up_after_endstop_or_probe_move() {
2403 2403
 
2404 2404
 #endif // HAS_BED_PROBE
2405 2405
 
2406
-#if PLANNER_LEVELING
2406
+#if HAS_LEVELING
2407 2407
   /**
2408 2408
    * Turn bed leveling on or off, fixing the current
2409 2409
    * position as-needed.
@@ -2511,7 +2511,7 @@ static void clean_up_after_endstop_or_probe_move() {
2511 2511
     #endif
2512 2512
   }
2513 2513
 
2514
-#endif // PLANNER_LEVELING
2514
+#endif // HAS_LEVELING
2515 2515
 
2516 2516
 #if ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(MESH_BED_LEVELING)
2517 2517
 
@@ -3747,7 +3747,7 @@ inline void gcode_G28() {
3747 3747
   #endif
3748 3748
 
3749 3749
   // Disable the leveling matrix before homing
3750
-  #if PLANNER_LEVELING
3750
+  #if HAS_LEVELING
3751 3751
     #if ENABLED(AUTO_BED_LEVELING_UBL)
3752 3752
       const bool bed_leveling_state_at_entry = ubl.state.active;
3753 3753
     #endif
@@ -4368,7 +4368,7 @@ void home_all_axes() { gcode_G28(); }
4368 4368
 
4369 4369
       #endif
4370 4370
 
4371
-      #if PLANNER_LEVELING
4371
+      #if HAS_LEVELING
4372 4372
 
4373 4373
         // Jettison bed leveling data
4374 4374
         if (code_seen('J')) {
@@ -5034,7 +5034,7 @@ void home_all_axes() { gcode_G28(); }
5034 5034
     if (!position_is_reachable(pos, true)) return;
5035 5035
 
5036 5036
     // Disable leveling so the planner won't mess with us
5037
-    #if PLANNER_LEVELING
5037
+    #if HAS_LEVELING
5038 5038
       set_bed_leveling_enabled(false);
5039 5039
     #endif
5040 5040
 
@@ -5091,7 +5091,7 @@ void home_all_axes() { gcode_G28(); }
5091 5091
 
5092 5092
       stepper.synchronize();
5093 5093
 
5094
-      #if PLANNER_LEVELING
5094
+      #if HAS_LEVELING
5095 5095
         set_bed_leveling_enabled(false);
5096 5096
       #endif
5097 5097
 
@@ -7294,7 +7294,7 @@ inline void gcode_M115() {
7294 7294
     #endif
7295 7295
 
7296 7296
     // MESH_REPORT (M420 V)
7297
-    #if PLANNER_LEVELING
7297
+    #if HAS_LEVELING
7298 7298
       SERIAL_PROTOCOLLNPGM("Cap:LEVELING_DATA:1");
7299 7299
     #else
7300 7300
       SERIAL_PROTOCOLLNPGM("Cap:LEVELING_DATA:0");
@@ -8336,7 +8336,7 @@ void quickstop_stepper() {
8336 8336
   SYNC_PLAN_POSITION_KINEMATIC();
8337 8337
 }
8338 8338
 
8339
-#if PLANNER_LEVELING
8339
+#if HAS_LEVELING
8340 8340
   /**
8341 8341
    * M420: Enable/Disable Bed Leveling and/or set the Z fade height.
8342 8342
    *
@@ -9857,12 +9857,12 @@ void process_next_command() {
9857 9857
         gcode_G28();
9858 9858
         break;
9859 9859
 
9860
-      #if PLANNER_LEVELING || ENABLED(AUTO_BED_LEVELING_UBL)
9860
+      #if HAS_LEVELING
9861 9861
         case 29: // G29 Detailed Z probe, probes the bed at 3 or more points,
9862 9862
                  // or provides access to the UBL System if enabled.
9863 9863
           gcode_G29();
9864 9864
           break;
9865
-      #endif // PLANNER_LEVELING
9865
+      #endif // HAS_LEVELING
9866 9866
 
9867 9867
       #if HAS_BED_PROBE
9868 9868
 
@@ -10363,7 +10363,7 @@ void process_next_command() {
10363 10363
           break;
10364 10364
       #endif // FILAMENT_WIDTH_SENSOR
10365 10365
 
10366
-      #if PLANNER_LEVELING
10366
+      #if HAS_LEVELING
10367 10367
         case 420: // M420: Enable/Disable Bed Leveling
10368 10368
           gcode_M420();
10369 10369
           break;
@@ -10917,7 +10917,7 @@ void get_cartesian_from_steppers() {
10917 10917
  */
10918 10918
 void set_current_from_steppers_for_axis(const AxisEnum axis) {
10919 10919
   get_cartesian_from_steppers();
10920
-  #if PLANNER_LEVELING && DISABLED(AUTO_BED_LEVELING_UBL)
10920
+  #if PLANNER_LEVELING
10921 10921
     planner.unapply_leveling(cartes);
10922 10922
   #endif
10923 10923
   if (axis == ALL_AXES)

+ 1
- 1
Marlin/configuration_store.cpp 查看文件

@@ -1071,7 +1071,7 @@ void MarlinSettings::reset() {
1071 1071
   #endif
1072 1072
 
1073 1073
   // Applies to all MBL and ABL
1074
-  #if PLANNER_LEVELING
1074
+  #if HAS_LEVELING
1075 1075
     reset_bed_level();
1076 1076
   #endif
1077 1077
 

+ 3
- 3
Marlin/planner.cpp 查看文件

@@ -530,7 +530,7 @@ void Planner::check_axes_activity() {
530 530
   #endif
531 531
 }
532 532
 
533
-#if PLANNER_LEVELING && DISABLED(AUTO_BED_LEVELING_UBL)
533
+#if PLANNER_LEVELING
534 534
   /**
535 535
    * lx, ly, lz - logical (cartesian, not delta) positions in mm
536 536
    */
@@ -634,7 +634,7 @@ void Planner::check_axes_activity() {
634 634
     #endif
635 635
   }
636 636
 
637
-#endif // PLANNER_LEVELING && !AUTO_BED_LEVELING_UBL
637
+#endif // PLANNER_LEVELING
638 638
 
639 639
 /**
640 640
  * Planner::_buffer_line
@@ -1434,7 +1434,7 @@ void Planner::_set_position_mm(const float &a, const float &b, const float &c, c
1434 1434
 }
1435 1435
 
1436 1436
 void Planner::set_position_mm_kinematic(const float position[NUM_AXIS]) {
1437
-  #if PLANNER_LEVELING && DISABLED(AUTO_BED_LEVELING_UBL)
1437
+  #if PLANNER_LEVELING
1438 1438
     float lpos[XYZ] = { position[X_AXIS], position[Y_AXIS], position[Z_AXIS] };
1439 1439
     apply_leveling(lpos);
1440 1440
   #else

+ 4
- 4
Marlin/planner.h 查看文件

@@ -246,7 +246,7 @@ class Planner {
246 246
 
247 247
     static bool is_full() { return (block_buffer_tail == BLOCK_MOD(block_buffer_head + 1)); }
248 248
 
249
-    #if PLANNER_LEVELING && DISABLED(AUTO_BED_LEVELING_UBL)
249
+    #if PLANNER_LEVELING
250 250
 
251 251
       #define ARG_X float lx
252 252
       #define ARG_Y float ly
@@ -296,7 +296,7 @@ class Planner {
296 296
      *  extruder     - target extruder
297 297
      */
298 298
     static FORCE_INLINE void buffer_line(ARG_X, ARG_Y, ARG_Z, const float &e, const float &fr_mm_s, const uint8_t extruder) {
299
-      #if PLANNER_LEVELING && DISABLED(AUTO_BED_LEVELING_UBL) && IS_CARTESIAN
299
+      #if PLANNER_LEVELING && IS_CARTESIAN
300 300
         apply_leveling(lx, ly, lz);
301 301
       #endif
302 302
       _buffer_line(lx, ly, lz, e, fr_mm_s, extruder);
@@ -312,7 +312,7 @@ class Planner {
312 312
      *  extruder - target extruder
313 313
      */
314 314
     static FORCE_INLINE void buffer_line_kinematic(const float ltarget[XYZE], const float &fr_mm_s, const uint8_t extruder) {
315
-      #if PLANNER_LEVELING && DISABLED(AUTO_BED_LEVELING_UBL)
315
+      #if PLANNER_LEVELING
316 316
         float lpos[XYZ] = { ltarget[X_AXIS], ltarget[Y_AXIS], ltarget[Z_AXIS] };
317 317
         apply_leveling(lpos);
318 318
       #else
@@ -336,7 +336,7 @@ class Planner {
336 336
      * Clears previous speed values.
337 337
      */
338 338
     static FORCE_INLINE void set_position_mm(ARG_X, ARG_Y, ARG_Z, const float &e) {
339
-      #if PLANNER_LEVELING && DISABLED(AUTO_BED_LEVELING_UBL) && IS_CARTESIAN
339
+      #if PLANNER_LEVELING && IS_CARTESIAN
340 340
         apply_leveling(lx, ly, lz);
341 341
       #endif
342 342
       _set_position_mm(lx, ly, lz, e);

Loading…
取消
儲存