From b07a2aa23cd94fa03814926f058900f8f589dc03 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 13 Oct 2017 20:47:44 -0500 Subject: [PATCH] Add HAS_MESH conditional --- Marlin/Conditionals_post.h | 7 +++++-- Marlin/Marlin_main.cpp | 16 ++++++++-------- Marlin/SanityCheck.h | 2 +- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Marlin/Conditionals_post.h b/Marlin/Conditionals_post.h index dc6f21236..0dcc96279 100644 --- a/Marlin/Conditionals_post.h +++ b/Marlin/Conditionals_post.h @@ -783,9 +783,12 @@ #define UBL_DELTA (ENABLED(AUTO_BED_LEVELING_UBL) && (ENABLED(DELTA) || ENABLED(UBL_GRANULAR_SEGMENTATION_FOR_CARTESIAN))) #define ABL_PLANAR (ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_3POINT)) #define ABL_GRID (ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR)) - #define HAS_ABL (ABL_PLANAR || ABL_GRID || ENABLED(AUTO_BED_LEVELING_UBL)) + #define OLDSCHOOL_ABL (ABL_PLANAR || ABL_GRID) + #define HAS_ABL (OLDSCHOOL_ABL || ENABLED(AUTO_BED_LEVELING_UBL)) #define HAS_LEVELING (HAS_ABL || ENABLED(MESH_BED_LEVELING)) - #define PLANNER_LEVELING (ABL_PLANAR || ABL_GRID || ENABLED(MESH_BED_LEVELING) || UBL_DELTA) + #define HAS_AUTOLEVEL (HAS_ABL && DISABLED(PROBE_MANUALLY)) + #define HAS_MESH (ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(MESH_BED_LEVELING)) + #define PLANNER_LEVELING (OLDSCHOOL_ABL || ENABLED(MESH_BED_LEVELING) || UBL_DELTA) #define HAS_PROBING_PROCEDURE (HAS_ABL || ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)) #if HAS_PROBING_PROCEDURE #define PROBE_BED_WIDTH abs(RIGHT_PROBE_BED_POSITION - (LEFT_PROBE_BED_POSITION)) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index b28ba0b89..9c2a97da4 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -4357,7 +4357,7 @@ void home_all_axes() { gcode_G28(true); } report_current_position(); } -#elif HAS_ABL && DISABLED(AUTO_BED_LEVELING_UBL) +#elif OLDSCHOOL_ABL #if ABL_GRID #if ENABLED(PROBE_Y_FIRST) @@ -5281,7 +5281,7 @@ void home_all_axes() { gcode_G28(true); } SYNC_PLAN_POSITION_KINEMATIC(); } -#endif // HAS_ABL && !AUTO_BED_LEVELING_UBL +#endif // OLDSCHOOL_ABL #if HAS_BED_PROBE @@ -5869,7 +5869,7 @@ void home_all_axes() { gcode_G28(true); } #endif // G38_PROBE_TARGET -#if ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(MESH_BED_LEVELING) +#if HAS_MESH /** * G42: Move X & Y axes to mesh coordinates (I & J) @@ -5921,7 +5921,7 @@ void home_all_axes() { gcode_G28(true); } } } -#endif // AUTO_BED_LEVELING_UBL +#endif // HAS_MESH /** * G92: Set current position to given X Y Z E @@ -10989,7 +10989,7 @@ void process_next_command() { gcode_G92(); break; - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(MESH_BED_LEVELING) + #if HAS_MESH case 42: gcode_G42(); break; @@ -11474,7 +11474,7 @@ void process_next_command() { break; #endif - #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(AUTO_BED_LEVELING_BILINEAR) + #if HAS_MESH case 421: // M421: Set a Mesh Bed Leveling Z coordinate gcode_M421(); break; @@ -12377,7 +12377,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) { inline bool prepare_move_to_destination_cartesian() { if (current_position[X_AXIS] != destination[X_AXIS] || current_position[Y_AXIS] != destination[Y_AXIS]) { const float fr_scaled = MMS_SCALED(feedrate_mm_s); - #if HAS_LEVELING + #if HAS_MESH if (planner.leveling_active) { #if ENABLED(AUTO_BED_LEVELING_UBL) ubl.line_to_destination_cartesian(fr_scaled, active_extruder); @@ -12388,7 +12388,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) { #endif return true; } - #endif // HAS_LEVELING + #endif // HAS_MESH line_to_destination(fr_scaled); } else diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 7d960f860..5d930347d 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -651,7 +651,7 @@ static_assert(1 >= 0 /** * Require some kind of probe for bed leveling and probe testing */ - #if HAS_ABL && DISABLED(AUTO_BED_LEVELING_UBL) + #if OLDSCHOOL_ABL #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." #endif