Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify PROBING_STEPPERS_OFF code by implying PROBING_ESTEPPERS_OFF #22581

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions Marlin/src/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -2932,10 +2932,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
Expand Down
19 changes: 7 additions & 12 deletions Marlin/src/module/probe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down