Shorthand for home-after-deactivate
This commit is contained in:
parent
30a3db4f22
commit
49627069a5
|
@ -200,18 +200,10 @@ void GcodeSuite::G28(const bool always_home_all) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (parser.boolval('O')) {
|
if (!homing_needed() && parser.boolval('O')) {
|
||||||
if (
|
|
||||||
#if ENABLED(HOME_AFTER_DEACTIVATE)
|
|
||||||
all_axes_known() // homing needed anytime steppers deactivate
|
|
||||||
#else
|
|
||||||
all_axes_homed() // homing needed only if never homed
|
|
||||||
#endif
|
|
||||||
) {
|
|
||||||
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("> homing not needed, skip\n<<< G28");
|
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("> homing not needed, skip\n<<< G28");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Wait for planner moves to finish!
|
// Wait for planner moves to finish!
|
||||||
planner.synchronize();
|
planner.synchronize();
|
||||||
|
|
|
@ -42,6 +42,16 @@ FORCE_INLINE bool all_axes_known() { return (axis_known_position & xyz_bits) ==
|
||||||
FORCE_INLINE void set_all_unhomed() { axis_homed = 0; }
|
FORCE_INLINE void set_all_unhomed() { axis_homed = 0; }
|
||||||
FORCE_INLINE void set_all_unknown() { axis_known_position = 0; }
|
FORCE_INLINE void set_all_unknown() { axis_known_position = 0; }
|
||||||
|
|
||||||
|
FORCE_INLINE bool homing_needed() {
|
||||||
|
return !(
|
||||||
|
#if ENABLED(HOME_AFTER_DEACTIVATE)
|
||||||
|
all_axes_known()
|
||||||
|
#else
|
||||||
|
all_axes_homed()
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Error margin to work around float imprecision
|
// Error margin to work around float imprecision
|
||||||
constexpr float slop = 0.0001;
|
constexpr float slop = 0.0001;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue