From f10c87b442dd5a3aa0e5a327d85e5c509c2cb02b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 10 Mar 2018 05:56:04 -0600 Subject: [PATCH] Update Endstops class for 1.1.x parity --- Marlin/src/module/endstops.cpp | 19 +++++++------------ Marlin/src/module/endstops.h | 21 ++++++++++----------- 2 files changed, 17 insertions(+), 23 deletions(-) diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index 06472e112..c6c84cee8 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -42,26 +42,22 @@ Endstops endstops; bool Endstops::enabled, Endstops::enabled_globally; // Initialized by settings.load() volatile char Endstops::endstop_hit_bits; // use X_MIN, Y_MIN, Z_MIN and Z_MIN_PROBE as BIT value -#if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - uint16_t -#else - byte -#endif - Endstops::current_endstop_bits = 0, - Endstops::old_endstop_bits = 0; +Endstops::esbits_t Endstops::current_endstop_bits = 0, + Endstops::old_endstop_bits = 0; #if HAS_BED_PROBE volatile bool Endstops::z_probe_enabled = false; #endif +// Initialized by settings.load() #if ENABLED(X_DUAL_ENDSTOPS) - float Endstops::x_endstop_adj; // Initialized by settings.load() + float Endstops::x_endstop_adj; #endif #if ENABLED(Y_DUAL_ENDSTOPS) - float Endstops::y_endstop_adj; // Initialized by settings.load() + float Endstops::y_endstop_adj; #endif #if ENABLED(Z_DUAL_ENDSTOPS) - float Endstops::z_endstop_adj; // Initialized by settings.load() + float Endstops::z_endstop_adj; #endif /** @@ -355,7 +351,7 @@ void Endstops::update() { _ENDSTOP_HIT(AXIS, MINMAX); \ stepper.endstop_triggered(_AXIS(AXIS)); \ } \ - } while(0) + }while(0) #if ENABLED(G38_PROBE_TARGET) && PIN_EXISTS(Z_MIN_PROBE) && !(CORE_IS_XY || CORE_IS_XZ) // If G38 command is active check Z_MIN_PROBE for ALL movement @@ -452,7 +448,6 @@ void Endstops::update() { /** * Check and update endstops according to conditions */ - if (X_MOVE_TEST) { if (stepper.motor_direction(X_AXIS_HEAD)) { // -direction #if HAS_X_MIN diff --git a/Marlin/src/module/endstops.h b/Marlin/src/module/endstops.h index 3f3ed5c27..5ff5af454 100644 --- a/Marlin/src/module/endstops.h +++ b/Marlin/src/module/endstops.h @@ -21,7 +21,7 @@ */ /** - * endstops.h - manages endstops + * endstops.h - manages endstops */ #ifndef __ENDSTOPS_H__ @@ -53,17 +53,17 @@ class Endstops { static bool enabled, enabled_globally; static volatile char endstop_hit_bits; // use X_MIN, Y_MIN, Z_MIN and Z_MIN_PROBE as BIT value - #if ENABLED(X_DUAL_ENDSTOPS) - static float x_endstop_adj; - #endif - #if ENABLED(Y_DUAL_ENDSTOPS) - static float y_endstop_adj; - #endif - #if ENABLED(Z_DUAL_ENDSTOPS) - static float z_endstop_adj; - #endif #if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) typedef uint16_t esbits_t; + #if ENABLED(X_DUAL_ENDSTOPS) + static float x_endstop_adj; + #endif + #if ENABLED(Y_DUAL_ENDSTOPS) + static float y_endstop_adj; + #endif + #if ENABLED(Z_DUAL_ENDSTOPS) + static float z_endstop_adj; + #endif #else typedef byte esbits_t; #endif @@ -152,5 +152,4 @@ extern Endstops endstops; #define ENDSTOPS_ENABLED endstops.enabled #endif - #endif // __ENDSTOPS_H__