From 11070b79a3aceb600c260cb8eb0758f46b7b4784 Mon Sep 17 00:00:00 2001
From: Jason Smith <jason.inet@gmail.com>
Date: Tue, 17 Aug 2021 20:35:12 -0700
Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Simplify=20PROBING=5FSTEPP?=
 =?UTF-8?q?ERS=5FOFF=20(#22581)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 Marlin/src/inc/Conditionals_post.h |  7 +++----
 Marlin/src/module/probe.cpp        | 19 +++++++------------
 2 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h
index 8c5b6ef9b0..2fb276b10c 100644
--- a/Marlin/src/inc/Conditionals_post.h
+++ b/Marlin/src/inc/Conditionals_post.h
@@ -3274,10 +3274,9 @@
 #endif
 #if !BOTH(HAS_BED_PROBE, HAS_EXTRUDERS)
   #undef PROBING_ESTEPPERS_OFF
-#endif
-#if BOTH(PROBING_STEPPERS_OFF, PROBING_ESTEPPERS_OFF)
-  #undef PROBING_ESTEPPERS_OFF
-  #warning "PROBING_STEPPERS_OFF includes PROBING_ESTEPPERS_OFF. Disabling PROBING_ESTEPPERS_OFF."
+#elif ENABLED(PROBING_STEPPERS_OFF)
+  // PROBING_STEPPERS_OFF implies PROBING_ESTEPPERS_OFF, make sure it is defined
+  #define PROBING_ESTEPPERS_OFF
 #endif
 #if EITHER(ADVANCED_PAUSE_FEATURE, PROBING_HEATERS_OFF)
   #define HEATER_IDLE_HANDLER 1
diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp
index d0f32a32c0..ded5d43893 100644
--- a/Marlin/src/module/probe.cpp
+++ b/Marlin/src/module/probe.cpp
@@ -250,21 +250,16 @@ xyz_pos_t Probe::offset; // Initialized by settings.load()
     TERN_(PROBING_HEATERS_OFF, thermalManager.pause_heaters(dopause));
     TERN_(PROBING_FANS_OFF, thermalManager.set_fans_paused(dopause));
     TERN_(PROBING_ESTEPPERS_OFF, if (dopause) disable_e_steppers());
-    #if ENABLED(PROBING_STEPPERS_OFF)
-      IF_DISABLED(DELTA, static uint8_t old_trusted);
+    #if ENABLED(PROBING_STEPPERS_OFF) && DISABLED(DELTA)
+      static uint8_t old_trusted;
       if (dopause) {
-        #if DISABLED(DELTA)
-          old_trusted = axis_trusted;
-          DISABLE_AXIS_X();
-          DISABLE_AXIS_Y();
-        #endif
-        IF_DISABLED(PROBING_ESTEPPERS_OFF, disable_e_steppers());
+        old_trusted = axis_trusted;
+        DISABLE_AXIS_X();
+        DISABLE_AXIS_Y();
       }
       else {
-        #if DISABLED(DELTA)
-          if (TEST(old_trusted, X_AXIS)) ENABLE_AXIS_X();
-          if (TEST(old_trusted, Y_AXIS)) ENABLE_AXIS_Y();
-        #endif
+        if (TEST(old_trusted, X_AXIS)) ENABLE_AXIS_X();
+        if (TEST(old_trusted, Y_AXIS)) ENABLE_AXIS_Y();
         axis_trusted = old_trusted;
       }
     #endif