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

@ -42,15 +42,9 @@ class Endstops {
public:
#if HAS_EXTRA_ENDSTOPS
typedef uint16_t esbits_t;
#if ENABLED(X_DUAL_ENDSTOPS)
static float x2_endstop_adj;
#endif
#if ENABLED(Y_DUAL_ENDSTOPS)
static float y2_endstop_adj;
#endif
#if ENABLED(Z_MULTI_ENDSTOPS)
static float z2_endstop_adj;
#endif
TERN_(X_DUAL_ENDSTOPS, static float x2_endstop_adj);
TERN_(Y_DUAL_ENDSTOPS, static float y2_endstop_adj);
TERN_(Z_MULTI_ENDSTOPS, static float z2_endstop_adj);
#if ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 3
static float z3_endstop_adj;
#endif
@ -83,11 +77,7 @@ class Endstops {
* Are endstops or the probe set to abort the move?
*/
FORCE_INLINE static bool abort_enabled() {
return (enabled
#if HAS_BED_PROBE
|| z_probe_enabled
#endif
);
return enabled || TERN0(HAS_BED_PROBE, z_probe_enabled);
}
static inline bool global_enabled() { return enabled_globally; }