Browse Source

⚡️ Simplify PROBING_STEPPERS_OFF (#22581)

Jason Smith 3 years ago
parent
commit
c05de6cbf8
No account linked to committer's email address
2 changed files with 10 additions and 16 deletions
  1. 3
    4
      Marlin/src/inc/Conditionals_post.h
  2. 7
    12
      Marlin/src/module/probe.cpp

+ 3
- 4
Marlin/src/inc/Conditionals_post.h View File

2932
 #endif
2932
 #endif
2933
 #if !BOTH(HAS_BED_PROBE, HAS_EXTRUDERS)
2933
 #if !BOTH(HAS_BED_PROBE, HAS_EXTRUDERS)
2934
   #undef PROBING_ESTEPPERS_OFF
2934
   #undef PROBING_ESTEPPERS_OFF
2935
-#endif
2936
-#if BOTH(PROBING_STEPPERS_OFF, PROBING_ESTEPPERS_OFF)
2937
-  #undef PROBING_ESTEPPERS_OFF
2938
-  #warning "PROBING_STEPPERS_OFF includes PROBING_ESTEPPERS_OFF. Disabling PROBING_ESTEPPERS_OFF."
2935
+#elif ENABLED(PROBING_STEPPERS_OFF)
2936
+  // PROBING_STEPPERS_OFF implies PROBING_ESTEPPERS_OFF, make sure it is defined
2937
+  #define PROBING_ESTEPPERS_OFF
2939
 #endif
2938
 #endif
2940
 #if EITHER(ADVANCED_PAUSE_FEATURE, PROBING_HEATERS_OFF)
2939
 #if EITHER(ADVANCED_PAUSE_FEATURE, PROBING_HEATERS_OFF)
2941
   #define HEATER_IDLE_HANDLER 1
2940
   #define HEATER_IDLE_HANDLER 1

+ 7
- 12
Marlin/src/module/probe.cpp View File

250
     TERN_(PROBING_HEATERS_OFF, thermalManager.pause_heaters(dopause));
250
     TERN_(PROBING_HEATERS_OFF, thermalManager.pause_heaters(dopause));
251
     TERN_(PROBING_FANS_OFF, thermalManager.set_fans_paused(dopause));
251
     TERN_(PROBING_FANS_OFF, thermalManager.set_fans_paused(dopause));
252
     TERN_(PROBING_ESTEPPERS_OFF, if (dopause) disable_e_steppers());
252
     TERN_(PROBING_ESTEPPERS_OFF, if (dopause) disable_e_steppers());
253
-    #if ENABLED(PROBING_STEPPERS_OFF)
254
-      IF_DISABLED(DELTA, static uint8_t old_trusted);
253
+    #if ENABLED(PROBING_STEPPERS_OFF) && DISABLED(DELTA)
254
+      static uint8_t old_trusted;
255
       if (dopause) {
255
       if (dopause) {
256
-        #if DISABLED(DELTA)
257
-          old_trusted = axis_trusted;
258
-          DISABLE_AXIS_X();
259
-          DISABLE_AXIS_Y();
260
-        #endif
261
-        IF_DISABLED(PROBING_ESTEPPERS_OFF, disable_e_steppers());
256
+        old_trusted = axis_trusted;
257
+        DISABLE_AXIS_X();
258
+        DISABLE_AXIS_Y();
262
       }
259
       }
263
       else {
260
       else {
264
-        #if DISABLED(DELTA)
265
-          if (TEST(old_trusted, X_AXIS)) ENABLE_AXIS_X();
266
-          if (TEST(old_trusted, Y_AXIS)) ENABLE_AXIS_Y();
267
-        #endif
261
+        if (TEST(old_trusted, X_AXIS)) ENABLE_AXIS_X();
262
+        if (TEST(old_trusted, Y_AXIS)) ENABLE_AXIS_Y();
268
         axis_trusted = old_trusted;
263
         axis_trusted = old_trusted;
269
       }
264
       }
270
     #endif
265
     #endif

Loading…
Cancel
Save