From 33185b090e264a923a8d2fb0687846fe100f5465 Mon Sep 17 00:00:00 2001
From: cr20-123 <66994235+cr20-123@users.noreply.github.com>
Date: Sat, 26 Jun 2021 14:17:18 -0400
Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Update/extend=20Quiet=20Probing=20(?=
 =?UTF-8?q?#22205)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 Marlin/Configuration.h             |  3 ++-
 Marlin/src/inc/Conditionals_post.h | 19 ++++++++++++++-----
 Marlin/src/module/probe.cpp        |  3 ++-
 buildroot/tests/rambo              |  4 ++--
 4 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h
index 5b7f439fe51..d3221f80dee 100644
--- a/Marlin/Configuration.h
+++ b/Marlin/Configuration.h
@@ -1250,7 +1250,8 @@
   //#define WAIT_FOR_HOTEND         // Wait for hotend to heat back up between probes (to improve accuracy & prevent cold extrude)
 #endif
 //#define PROBING_FANS_OFF          // Turn fans off when probing
-//#define PROBING_STEPPERS_OFF      // Turn steppers off (unless needed to hold position) when probing
+//#define PROBING_ESTEPPERS_OFF     // Turn all extruder steppers off when probing
+//#define PROBING_STEPPERS_OFF      // Turn all steppers off (unless needed to hold position) when probing (including extruders)
 //#define DELAY_BEFORE_PROBING 200  // (ms) To prevent vibrations from triggering piezo sensors
 
 // Require minimum nozzle and/or bed temperature for probing
diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h
index eb215c34ebe..32ae0fdef47 100644
--- a/Marlin/src/inc/Conditionals_post.h
+++ b/Marlin/src/inc/Conditionals_post.h
@@ -3099,6 +3099,7 @@
   #endif
 #else
   #undef NOZZLE_TO_PROBE_OFFSET
+  #undef PROBING_STEPPERS_OFF
 #endif
 
 /**
@@ -3141,18 +3142,26 @@
 /**
  * Heater, Fan, and Probe interactions
  */
-#if FAN_COUNT == 0
-  #undef PROBING_FANS_OFF
+#if !HAS_FAN
   #undef ADAPTIVE_FAN_SLOWING
   #undef NO_FAN_SLOWING_IN_PID_TUNING
 #endif
-
-#if HAS_BED_PROBE && (EITHER(PROBING_HEATERS_OFF, PROBING_FANS_OFF) || DELAY_BEFORE_PROBING > 0)
-  #define HAS_QUIET_PROBING 1
+#if !BOTH(HAS_BED_PROBE, HAS_FAN)
+  #undef PROBING_FANS_OFF
+#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."
 #endif
 #if EITHER(ADVANCED_PAUSE_FEATURE, PROBING_HEATERS_OFF)
   #define HEATER_IDLE_HANDLER 1
 #endif
+#if HAS_BED_PROBE && (ANY(PROBING_HEATERS_OFF, PROBING_STEPPERS_OFF, PROBING_ESTEPPERS_OFF, PROBING_FANS_OFF) || DELAY_BEFORE_PROBING > 0)
+  #define HAS_QUIET_PROBING 1
+#endif
 
 /**
  * Advanced Pause - Filament Change
diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp
index 2b3a1898844..dae25feea3e 100644
--- a/Marlin/src/module/probe.cpp
+++ b/Marlin/src/module/probe.cpp
@@ -245,6 +245,7 @@ xyz_pos_t Probe::offset; // Initialized by settings.load()
   void Probe::set_probing_paused(const bool dopause) {
     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 (dopause) {
@@ -253,7 +254,7 @@ xyz_pos_t Probe::offset; // Initialized by settings.load()
           DISABLE_AXIS_X();
           DISABLE_AXIS_Y();
         #endif
-        disable_e_steppers();
+        IF_DISABLED(PROBING_ESTEPPERS_OFF, disable_e_steppers());
       }
       else {
         #if DISABLED(DELTA)
diff --git a/buildroot/tests/rambo b/buildroot/tests/rambo
index 9c56a689b03..6b87d01a5e8 100755
--- a/buildroot/tests/rambo
+++ b/buildroot/tests/rambo
@@ -115,10 +115,10 @@ opt_set MOTHERBOARD BOARD_RAMBO \
         FAN_MIN_PWM 50 FAN_KICKSTART_TIME 100 \
         XY_FREQUENCY_LIMIT 15
 opt_enable COREYX USE_XMAX_PLUG MIXING_EXTRUDER GRADIENT_MIX \
-           BABYSTEPPING BABYSTEP_DISPLAY_TOTAL FILAMENT_LCD_DISPLAY \
+           BABYSTEPPING BABYSTEP_DISPLAY_TOTAL FILAMENT_LCD_DISPLAY FILAMENT_WIDTH_SENSOR \
            REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER MENU_ADDAUTOSTART SDSUPPORT SDCARD_SORT_ALPHA \
            ENDSTOP_NOISE_THRESHOLD FAN_SOFT_PWM \
-           FIX_MOUNTED_PROBE AUTO_BED_LEVELING_LINEAR DEBUG_LEVELING_FEATURE FILAMENT_WIDTH_SENSOR PROBE_OFFSET_WIZARD \
+           FIX_MOUNTED_PROBE PROBING_ESTEPPERS_OFF AUTO_BED_LEVELING_LINEAR DEBUG_LEVELING_FEATURE PROBE_OFFSET_WIZARD \
            Z_SAFE_HOMING SHOW_TEMP_ADC_VALUES HOME_Y_BEFORE_X EMERGENCY_PARSER \
            SD_ABORT_ON_ENDSTOP_HIT HOST_ACTION_COMMANDS HOST_PROMPT_SUPPORT ADVANCED_OK M114_DETAIL \
            VOLUMETRIC_DEFAULT_ON NO_WORKSPACE_OFFSETS EXTRA_FAN_SPEED FWRETRACT \