Apply TERN to compact code (#17619)

This commit is contained in:
Scott Lahteine
2020-04-22 16:35:03 -05:00
committed by GitHub
parent 88bdd26c99
commit 6d90d1e1f5
162 changed files with 1493 additions and 3530 deletions

View File

@ -44,13 +44,7 @@ FORCE_INLINE void set_all_unhomed() { axis_homed = 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
);
return !TERN(HOME_AFTER_DEACTIVATE, all_axes_known, all_axes_homed)();
}
// Error margin to work around float imprecision
@ -136,7 +130,7 @@ inline float home_bump_mm(const AxisEnum axis) {
#if HAS_WORKSPACE_OFFSET
void update_workspace_offset(const AxisEnum axis);
#else
#define update_workspace_offset(x) NOOP
inline void update_workspace_offset(const AxisEnum) {}
#endif
#if HAS_HOTEND_OFFSET