Browse Source

Add HAS_MESH conditional

Scott Lahteine 7 years ago
parent
commit
b07a2aa23c
3 changed files with 14 additions and 11 deletions
  1. 5
    2
      Marlin/Conditionals_post.h
  2. 8
    8
      Marlin/Marlin_main.cpp
  3. 1
    1
      Marlin/SanityCheck.h

+ 5
- 2
Marlin/Conditionals_post.h View File

@@ -783,9 +783,12 @@
783 783
   #define UBL_DELTA  (ENABLED(AUTO_BED_LEVELING_UBL) && (ENABLED(DELTA) || ENABLED(UBL_GRANULAR_SEGMENTATION_FOR_CARTESIAN)))
784 784
   #define ABL_PLANAR (ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_3POINT))
785 785
   #define ABL_GRID   (ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR))
786
-  #define HAS_ABL    (ABL_PLANAR || ABL_GRID || ENABLED(AUTO_BED_LEVELING_UBL))
786
+  #define OLDSCHOOL_ABL         (ABL_PLANAR || ABL_GRID)
787
+  #define HAS_ABL               (OLDSCHOOL_ABL || ENABLED(AUTO_BED_LEVELING_UBL))
787 788
   #define HAS_LEVELING          (HAS_ABL || ENABLED(MESH_BED_LEVELING))
788
-  #define PLANNER_LEVELING      (ABL_PLANAR || ABL_GRID || ENABLED(MESH_BED_LEVELING) || UBL_DELTA)
789
+  #define HAS_AUTOLEVEL         (HAS_ABL && DISABLED(PROBE_MANUALLY))
790
+  #define HAS_MESH              (ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(MESH_BED_LEVELING))
791
+  #define PLANNER_LEVELING      (OLDSCHOOL_ABL || ENABLED(MESH_BED_LEVELING) || UBL_DELTA)
789 792
   #define HAS_PROBING_PROCEDURE (HAS_ABL || ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST))
790 793
   #if HAS_PROBING_PROCEDURE
791 794
     #define PROBE_BED_WIDTH abs(RIGHT_PROBE_BED_POSITION - (LEFT_PROBE_BED_POSITION))

+ 8
- 8
Marlin/Marlin_main.cpp View File

@@ -4357,7 +4357,7 @@ void home_all_axes() { gcode_G28(true); }
4357 4357
     report_current_position();
4358 4358
   }
4359 4359
 
4360
-#elif HAS_ABL && DISABLED(AUTO_BED_LEVELING_UBL)
4360
+#elif OLDSCHOOL_ABL
4361 4361
 
4362 4362
   #if ABL_GRID
4363 4363
     #if ENABLED(PROBE_Y_FIRST)
@@ -5281,7 +5281,7 @@ void home_all_axes() { gcode_G28(true); }
5281 5281
       SYNC_PLAN_POSITION_KINEMATIC();
5282 5282
   }
5283 5283
 
5284
-#endif // HAS_ABL && !AUTO_BED_LEVELING_UBL
5284
+#endif // OLDSCHOOL_ABL
5285 5285
 
5286 5286
 #if HAS_BED_PROBE
5287 5287
 
@@ -5869,7 +5869,7 @@ void home_all_axes() { gcode_G28(true); }
5869 5869
 
5870 5870
 #endif // G38_PROBE_TARGET
5871 5871
 
5872
-#if ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(MESH_BED_LEVELING)
5872
+#if HAS_MESH
5873 5873
 
5874 5874
   /**
5875 5875
    * G42: Move X & Y axes to mesh coordinates (I & J)
@@ -5921,7 +5921,7 @@ void home_all_axes() { gcode_G28(true); }
5921 5921
     }
5922 5922
   }
5923 5923
 
5924
-#endif // AUTO_BED_LEVELING_UBL
5924
+#endif // HAS_MESH
5925 5925
 
5926 5926
 /**
5927 5927
  * G92: Set current position to given X Y Z E
@@ -10989,7 +10989,7 @@ void process_next_command() {
10989 10989
         gcode_G92();
10990 10990
         break;
10991 10991
 
10992
-      #if ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(MESH_BED_LEVELING)
10992
+      #if HAS_MESH
10993 10993
         case 42:
10994 10994
           gcode_G42();
10995 10995
           break;
@@ -11474,7 +11474,7 @@ void process_next_command() {
11474 11474
           break;
11475 11475
       #endif
11476 11476
 
11477
-      #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(AUTO_BED_LEVELING_BILINEAR)
11477
+      #if HAS_MESH
11478 11478
         case 421: // M421: Set a Mesh Bed Leveling Z coordinate
11479 11479
           gcode_M421();
11480 11480
           break;
@@ -12377,7 +12377,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
12377 12377
   inline bool prepare_move_to_destination_cartesian() {
12378 12378
     if (current_position[X_AXIS] != destination[X_AXIS] || current_position[Y_AXIS] != destination[Y_AXIS]) {
12379 12379
       const float fr_scaled = MMS_SCALED(feedrate_mm_s);
12380
-      #if HAS_LEVELING
12380
+      #if HAS_MESH
12381 12381
         if (planner.leveling_active) {
12382 12382
           #if ENABLED(AUTO_BED_LEVELING_UBL)
12383 12383
             ubl.line_to_destination_cartesian(fr_scaled, active_extruder);
@@ -12388,7 +12388,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
12388 12388
           #endif
12389 12389
           return true;
12390 12390
         }
12391
-      #endif // HAS_LEVELING
12391
+      #endif // HAS_MESH
12392 12392
       line_to_destination(fr_scaled);
12393 12393
     }
12394 12394
     else

+ 1
- 1
Marlin/SanityCheck.h View File

@@ -651,7 +651,7 @@ static_assert(1 >= 0
651 651
   /**
652 652
    * Require some kind of probe for bed leveling and probe testing
653 653
    */
654
-  #if HAS_ABL && DISABLED(AUTO_BED_LEVELING_UBL)
654
+  #if OLDSCHOOL_ABL
655 655
     #error "Auto Bed Leveling requires one of these: PROBE_MANUALLY, FIX_MOUNTED_PROBE, BLTOUCH, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or a Z Servo."
656 656
   #endif
657 657
 

Loading…
Cancel
Save