From 62cbaa302e6969f572bdbfac12e222a1c3ff456d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 20 Mar 2017 06:10:31 -0500 Subject: [PATCH] Z_DUAL_ENDSTOP - make offset a configuration item The offset for Z_DUAL_ENDSTOP (z_endstop_adj) is already in Marlin. This PR just makes it a configuration item. z_endstop_adj is initialized in two places so both had to be modified. --- Marlin/Configuration_adv.h | 1 + Marlin/configuration_store.cpp | 6 +++++- Marlin/example_configurations/Cartesio/Configuration_adv.h | 1 + Marlin/example_configurations/Felix/Configuration_adv.h | 1 + Marlin/example_configurations/Hephestos/Configuration_adv.h | 1 + .../example_configurations/Hephestos_2/Configuration_adv.h | 1 + Marlin/example_configurations/K8200/Configuration_adv.h | 1 + Marlin/example_configurations/K8400/Configuration_adv.h | 1 + Marlin/example_configurations/RigidBot/Configuration_adv.h | 1 + Marlin/example_configurations/SCARA/Configuration_adv.h | 1 + Marlin/example_configurations/TAZ4/Configuration_adv.h | 1 + Marlin/example_configurations/WITBOX/Configuration_adv.h | 1 + .../delta/flsun_kossel_mini/Configuration_adv.h | 1 + .../delta/generic/Configuration_adv.h | 1 + .../delta/kossel_mini/Configuration_adv.h | 1 + .../delta/kossel_pro/Configuration_adv.h | 1 + .../delta/kossel_xl/Configuration_adv.h | 1 + Marlin/example_configurations/makibox/Configuration_adv.h | 1 + .../tvrrug/Round2/Configuration_adv.h | 1 + 19 files changed, 23 insertions(+), 1 deletion(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index a22e6dc902..44e3e3d30a 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -285,6 +285,7 @@ #if ENABLED(Z_DUAL_ENDSTOPS) #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 // use M666 command to determine/test this value #endif #endif // Z_DUAL_STEPPER_DRIVERS diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index eddf51b538..c16666c484 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -963,7 +963,11 @@ void Config_ResetDefault() { COPY(delta_diagonal_rod_trim, drt); COPY(delta_tower_angle_trim, dta); #elif ENABLED(Z_DUAL_ENDSTOPS) - z_endstop_adj = 0; + #if defined(Z_DUAL_ENDSTOPS_ADJUSTMENT) + float z_endstop_adj = Z_DUAL_ENDSTOPS_ADJUSTMENT; + #else + float z_endstop_adj = 0; + #endif #endif #if ENABLED(ULTIPANEL) diff --git a/Marlin/example_configurations/Cartesio/Configuration_adv.h b/Marlin/example_configurations/Cartesio/Configuration_adv.h index 8f4828684b..63ab14e943 100644 --- a/Marlin/example_configurations/Cartesio/Configuration_adv.h +++ b/Marlin/example_configurations/Cartesio/Configuration_adv.h @@ -285,6 +285,7 @@ #if ENABLED(Z_DUAL_ENDSTOPS) #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 // use M666 command to determine this value #endif #endif // Z_DUAL_STEPPER_DRIVERS diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index 3ad29213af..653c1b4486 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -285,6 +285,7 @@ #if ENABLED(Z_DUAL_ENDSTOPS) #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 // use M666 command to determine this value #endif #endif // Z_DUAL_STEPPER_DRIVERS diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h index 6b9015bd08..b85e925de4 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -285,6 +285,7 @@ #if ENABLED(Z_DUAL_ENDSTOPS) #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 // use M666 command to determine this value #endif #endif // Z_DUAL_STEPPER_DRIVERS diff --git a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h index 74fce16af6..9dd44e7c46 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h @@ -285,6 +285,7 @@ #if ENABLED(Z_DUAL_ENDSTOPS) #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 // use M666 command to determine this value #endif #endif // Z_DUAL_STEPPER_DRIVERS diff --git a/Marlin/example_configurations/K8200/Configuration_adv.h b/Marlin/example_configurations/K8200/Configuration_adv.h index 038e19a762..68af644264 100644 --- a/Marlin/example_configurations/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/K8200/Configuration_adv.h @@ -298,6 +298,7 @@ #if ENABLED(Z_DUAL_ENDSTOPS) #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 // use M666 command to determine this value #endif #endif // Z_DUAL_STEPPER_DRIVERS diff --git a/Marlin/example_configurations/K8400/Configuration_adv.h b/Marlin/example_configurations/K8400/Configuration_adv.h index 6c9fadb181..4f21df5bd4 100644 --- a/Marlin/example_configurations/K8400/Configuration_adv.h +++ b/Marlin/example_configurations/K8400/Configuration_adv.h @@ -285,6 +285,7 @@ #if ENABLED(Z_DUAL_ENDSTOPS) #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 // use M666 command to determine this value #endif #endif // Z_DUAL_STEPPER_DRIVERS diff --git a/Marlin/example_configurations/RigidBot/Configuration_adv.h b/Marlin/example_configurations/RigidBot/Configuration_adv.h index 6187556c78..78d542d70a 100644 --- a/Marlin/example_configurations/RigidBot/Configuration_adv.h +++ b/Marlin/example_configurations/RigidBot/Configuration_adv.h @@ -285,6 +285,7 @@ #if ENABLED(Z_DUAL_ENDSTOPS) #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 // use M666 command to determine this value #endif #endif // Z_DUAL_STEPPER_DRIVERS diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index 293214d2a0..ded7a7cc7b 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -285,6 +285,7 @@ #if ENABLED(Z_DUAL_ENDSTOPS) #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 // use M666 command to determine this value #endif #endif // Z_DUAL_STEPPER_DRIVERS diff --git a/Marlin/example_configurations/TAZ4/Configuration_adv.h b/Marlin/example_configurations/TAZ4/Configuration_adv.h index 168a398b5d..02d4287386 100644 --- a/Marlin/example_configurations/TAZ4/Configuration_adv.h +++ b/Marlin/example_configurations/TAZ4/Configuration_adv.h @@ -293,6 +293,7 @@ #if ENABLED(Z_DUAL_ENDSTOPS) #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 // use M666 command to determine this value #endif #endif // Z_DUAL_STEPPER_DRIVERS diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h index 6b9015bd08..b85e925de4 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -285,6 +285,7 @@ #if ENABLED(Z_DUAL_ENDSTOPS) #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 // use M666 command to determine this value #endif #endif // Z_DUAL_STEPPER_DRIVERS diff --git a/Marlin/example_configurations/delta/flsun_kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/flsun_kossel_mini/Configuration_adv.h index b974eea21f..da605cadf2 100644 --- a/Marlin/example_configurations/delta/flsun_kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/flsun_kossel_mini/Configuration_adv.h @@ -285,6 +285,7 @@ #if ENABLED(Z_DUAL_ENDSTOPS) #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 // use M666 command to determine this value #endif #endif // Z_DUAL_STEPPER_DRIVERS diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index f3f15070c8..9631948e3e 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -285,6 +285,7 @@ #if ENABLED(Z_DUAL_ENDSTOPS) #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 // use M666 command to determine this value #endif #endif // Z_DUAL_STEPPER_DRIVERS diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index f3f15070c8..9631948e3e 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -285,6 +285,7 @@ #if ENABLED(Z_DUAL_ENDSTOPS) #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 // use M666 command to determine this value #endif #endif // Z_DUAL_STEPPER_DRIVERS diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h index b17c39f205..37d185b58d 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h @@ -290,6 +290,7 @@ #if ENABLED(Z_DUAL_ENDSTOPS) #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 // use M666 command to determine this value #endif #endif // Z_DUAL_STEPPER_DRIVERS diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h index fa9cdbd9fe..01edfc19cb 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h @@ -285,6 +285,7 @@ #if ENABLED(Z_DUAL_ENDSTOPS) #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 // use M666 command to determine this value #endif #endif // Z_DUAL_STEPPER_DRIVERS diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index 48936b3168..ae793ed755 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -285,6 +285,7 @@ #if ENABLED(Z_DUAL_ENDSTOPS) #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 // use M666 command to determine this value #endif #endif // Z_DUAL_STEPPER_DRIVERS diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index 364a8a9439..1c47f8560f 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -285,6 +285,7 @@ #if ENABLED(Z_DUAL_ENDSTOPS) #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 // use M666 command to determine this value #endif #endif // Z_DUAL_STEPPER_DRIVERS