From 39578a5919dddf227f4d79910c43ea04c4d1d103 Mon Sep 17 00:00:00 2001
From: Scott Lahteine <github@thinkyhead.com>
Date: Wed, 25 Sep 2019 19:57:41 -0500
Subject: [PATCH] Fix probe without leveling

---
 Marlin/src/module/probe.h | 79 +++++++++++++++++++++------------------
 1 file changed, 43 insertions(+), 36 deletions(-)

diff --git a/Marlin/src/module/probe.h b/Marlin/src/module/probe.h
index 502777691..8efb75e41 100644
--- a/Marlin/src/module/probe.h
+++ b/Marlin/src/module/probe.h
@@ -50,42 +50,49 @@
     extern const char msg_wait_for_bed_heating[25];
   #endif
 
-  inline float probe_min_x() {
-    return _MAX(
-      #if ENABLED(DELTA) || IS_SCARA
-        PROBE_X_MIN, MESH_MIN_X
-      #else
-        (X_MIN_BED) + (MIN_PROBE_EDGE), (X_MIN_POS) + probe_offset[X_AXIS]
-      #endif
-    );
-  }
-  inline float probe_max_x() {
-    return _MIN(
-      #if ENABLED(DELTA) || IS_SCARA
-        PROBE_X_MAX, MESH_MAX_X
-      #else
-        (X_MAX_BED) - (MIN_PROBE_EDGE), (X_MAX_POS) + probe_offset[X_AXIS]
-      #endif
-    );
-  }
-  inline float probe_min_y() {
-    return _MAX(
-      #if ENABLED(DELTA) || IS_SCARA
-        PROBE_Y_MIN, MESH_MIN_Y
-      #else
-        (Y_MIN_BED) + (MIN_PROBE_EDGE), (Y_MIN_POS) + probe_offset[Y_AXIS]
-      #endif
-    );
-  }
-  inline float probe_max_y() {
-    return _MIN(
-      #if ENABLED(DELTA) || IS_SCARA
-        PROBE_Y_MAX, MESH_MAX_Y
-      #else
-        (Y_MAX_BED) - (MIN_PROBE_EDGE), (Y_MAX_POS) + probe_offset[Y_AXIS]
-      #endif
-    );
-  }
+  #if HAS_LEVELING
+
+    inline float probe_min_x() {
+      return _MAX(
+        #if ENABLED(DELTA) || IS_SCARA
+          PROBE_X_MIN, MESH_MIN_X
+        #else
+          (X_MIN_BED) + (MIN_PROBE_EDGE), (X_MIN_POS) + probe_offset[X_AXIS]
+        #endif
+      );
+    }
+
+    inline float probe_max_x() {
+      return _MIN(
+        #if ENABLED(DELTA) || IS_SCARA
+          PROBE_X_MAX, MESH_MAX_X
+        #else
+          (X_MAX_BED) - (MIN_PROBE_EDGE), (X_MAX_POS) + probe_offset[X_AXIS]
+        #endif
+      );
+    }
+
+    inline float probe_min_y() {
+      return _MAX(
+        #if ENABLED(DELTA) || IS_SCARA
+          PROBE_Y_MIN, MESH_MIN_Y
+        #else
+          (Y_MIN_BED) + (MIN_PROBE_EDGE), (Y_MIN_POS) + probe_offset[Y_AXIS]
+        #endif
+      );
+    }
+
+    inline float probe_max_y() {
+      return _MIN(
+        #if ENABLED(DELTA) || IS_SCARA
+          PROBE_Y_MAX, MESH_MAX_Y
+        #else
+          (Y_MAX_BED) - (MIN_PROBE_EDGE), (Y_MAX_POS) + probe_offset[Y_AXIS]
+        #endif
+      );
+    }
+
+  #endif
 
 #else