From 5dd87d2e740b2f7096e6869ae67e250adfdd92f9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 14 Apr 2015 04:05:51 -0700 Subject: [PATCH 1/2] Enable all old_z_*_endstop vars for Z_DUAL_ENDSTOPS - Potentially addressing #1911 --- Marlin/stepper.cpp | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 2ad555327d..9a243caabe 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -98,19 +98,12 @@ static volatile bool endstop_z_probe_hit = false; // Leaving this in even if Z_P #if HAS_Y_MAX static bool old_y_max_endstop = false; #endif -#if HAS_Z_MIN - static bool old_z_min_endstop = false; -#endif -#if HAS_Z_MAX - static bool old_z_max_endstop = false; -#endif + #ifdef Z_DUAL_ENDSTOPS - // #if HAS_Z2_MIN - static bool old_z2_min_endstop = false; - // #endif - // #if HAS_Z2_MAX - static bool old_z2_max_endstop = false; - // #endif + static bool old_z_min_endstop = false; + static bool old_z_max_endstop = false; + static bool old_z2_min_endstop = false; + static bool old_z2_max_endstop = false; #endif #ifdef Z_PROBE_ENDSTOP // No need to check for valid pin, SanityCheck.h already does this. From 7336e6df070a2f20e5f2cb9b3ac2d40c9da0c8c4 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 14 Apr 2015 04:55:20 -0700 Subject: [PATCH 2/2] Always define old_z, not always z2 --- Marlin/stepper.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 9a243caabe..f11cc04301 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -99,9 +99,10 @@ static volatile bool endstop_z_probe_hit = false; // Leaving this in even if Z_P static bool old_y_max_endstop = false; #endif +static bool old_z_min_endstop = false; +static bool old_z_max_endstop = false; + #ifdef Z_DUAL_ENDSTOPS - static bool old_z_min_endstop = false; - static bool old_z_max_endstop = false; static bool old_z2_min_endstop = false; static bool old_z2_max_endstop = false; #endif