From 071c742b8af2b700632f53d58dfbf60c3a9d9b84 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 2 Mar 2016 01:28:15 -0800 Subject: [PATCH 1/5] Move STRINGIFY to macros.h, use in language.h --- Marlin/macros.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/macros.h b/Marlin/macros.h index 4fce8eb539..be5e8cf2cf 100644 --- a/Marlin/macros.h +++ b/Marlin/macros.h @@ -24,8 +24,8 @@ #define MACROS_H // Macros to make a string from a macro -#define STRINGIFY_(n) #n -#define STRINGIFY(n) STRINGIFY_(n) +#define STRINGIFY_(M) #M +#define STRINGIFY(M) STRINGIFY_(M) // Macros for bit masks #define TEST(n,b) (((n)&_BV(b))!=0) From e5771346a42d327820328ca0e43ebdc6dd27ee2a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 2 Mar 2016 02:00:34 -0800 Subject: [PATCH 2/5] Drop DISABLE_M(IN|AX)_ENDSTOPS, replace with individual endstop flags --- Marlin/Conditionals.h | 14 ++++-- Marlin/Configuration.h | 16 ++++++- Marlin/SanityCheck.h | 13 ++++++ .../Felix/Configuration.h | 16 ++++++- .../Felix/Configuration_DUAL.h | 16 ++++++- .../Hephestos/Configuration.h | 16 ++++++- .../K8200/Configuration.h | 16 ++++++- .../RepRapWorld/Megatronics/Configuration.h | 16 ++++++- .../RigidBot/Configuration.h | 16 ++++++- .../SCARA/Configuration.h | 16 ++++++- .../TAZ4/Configuration.h | 16 ++++++- .../WITBOX/Configuration.h | 16 ++++++- .../adafruit/ST7565/Configuration.h | 16 ++++++- .../delta/biv2.5/Configuration.h | 16 ++++++- .../delta/generic/Configuration.h | 16 ++++++- .../delta/kossel_mini/Configuration.h | 16 ++++++- .../delta/kossel_pro/Configuration.h | 16 ++++++- .../makibox/Configuration.h | 16 ++++++- .../tvrrug/Round2/Configuration.h | 16 ++++++- Marlin/pins.h | 46 ++++++------------- Marlin/pins_FELIX2.h | 2 - 21 files changed, 276 insertions(+), 71 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 91760045d7..7e6e64c915 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -275,17 +275,25 @@ #include "Arduino.h" /** - * ENDSTOPPULLUPS + * Set ENDSTOPPULLUPS for unused endstop switches */ #if ENABLED(ENDSTOPPULLUPS) - #if DISABLED(DISABLE_MAX_ENDSTOPS) + #if DISABLED(USE_XMAX_PLUG) #define ENDSTOPPULLUP_XMAX + #endif + #if DISABLED(USE_YMAX_PLUG) #define ENDSTOPPULLUP_YMAX + #endif + #if DISABLED(USE_ZMAX_PLUG) #define ENDSTOPPULLUP_ZMAX #endif - #if DISABLED(DISABLE_MIN_ENDSTOPS) + #if DISABLED(USE_XMIN_PLUG) #define ENDSTOPPULLUP_XMIN + #endif + #if DISABLED(USE_YMIN_PLUG) #define ENDSTOPPULLUP_YMIN + #endif + #if DISABLED(USE_ZMIN_PLUG) #define ENDSTOPPULLUP_ZMIN #endif #if DISABLED(DISABLE_Z_MIN_PROBE_ENDSTOP) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 8debc70bd7..ddd72d11a0 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -346,8 +346,22 @@ // Enable this option for Toshiba steppers //#define CONFIG_STEPPERS_TOSHIBA +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + // @section homing +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + // coarse Endstop Settings #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors @@ -370,8 +384,6 @@ const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -//#define DISABLE_MAX_ENDSTOPS -//#define DISABLE_MIN_ENDSTOPS //=========================================================================== //============================= Z Probe Options ============================= diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index fb45e77b9f..c1edb4a5b4 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -419,6 +419,17 @@ #error TEMP_SENSOR_0 is required. #endif +/** + * Endstops + */ +#if DISABLED(HAS_ENDSTOP_X_MIN) && DISABLED(HAS_ENDSTOP_X_MAX) + #error You must enable HAS_ENDSTOP_X_MIN or HAS_ENDSTOP_X_MAX +#elif DISABLED(HAS_ENDSTOP_Y_MIN) && DISABLED(HAS_ENDSTOP_Y_MAX) + #error You must enable HAS_ENDSTOP_Y_MIN or HAS_ENDSTOP_Y_MAX +#elif DISABLED(HAS_ENDSTOP_Z_MIN) && DISABLED(HAS_ENDSTOP_Z_MAX) + #error You must enable HAS_ENDSTOP_Z_MIN or HAS_ENDSTOP_Z_MAX +#endif + /** * Warnings for old configurations */ @@ -456,6 +467,8 @@ #error Z_RAISE_BEFORE_HOMING is deprecated. Use MIN_Z_HEIGHT_FOR_HOMING instead. #elif defined(FILAMENT_SENSOR) #error FILAMENT_SENSOR is deprecated. Use FILAMENT_WIDTH_SENSOR instead. +#elif defined(DISABLE_MAX_ENDSTOPS) || defined(DISABLE_MIN_ENDSTOPS) + #error DISABLE_MAX_ENDSTOPS and DISABLE_MIN_ENDSTOPS deprecated - set USE_*_ENDSTOP flags instead #endif #endif //SANITYCHECK_H diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 3fd1646da8..e91e927c8a 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -328,8 +328,22 @@ // Enable this option for Toshiba steppers //#define CONFIG_STEPPERS_TOSHIBA +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + // @section homing +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + // coarse Endstop Settings #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors @@ -352,8 +366,6 @@ const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -#define DISABLE_MAX_ENDSTOPS -//#define DISABLE_MIN_ENDSTOPS //=========================================================================== //============================= Z Probe Options ============================= diff --git a/Marlin/example_configurations/Felix/Configuration_DUAL.h b/Marlin/example_configurations/Felix/Configuration_DUAL.h index 553c2dc60e..29507abaad 100644 --- a/Marlin/example_configurations/Felix/Configuration_DUAL.h +++ b/Marlin/example_configurations/Felix/Configuration_DUAL.h @@ -325,8 +325,22 @@ // Enable this option for Toshiba steppers //#define CONFIG_STEPPERS_TOSHIBA +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + // @section homing +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + // coarse Endstop Settings #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors @@ -349,8 +363,6 @@ const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -#define DISABLE_MAX_ENDSTOPS -//#define DISABLE_MIN_ENDSTOPS //=========================================================================== //============================= Z Probe Options ============================= diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 1d6faab46d..cac62233ff 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -338,8 +338,22 @@ // Enable this option for Toshiba steppers //#define CONFIG_STEPPERS_TOSHIBA +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + // @section homing +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + // coarse Endstop Settings #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors @@ -362,8 +376,6 @@ const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -#define DISABLE_MAX_ENDSTOPS -//#define DISABLE_MIN_ENDSTOPS //=========================================================================== //============================= Z Probe Options ============================= diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index e803d3e2b0..3bb350ddd4 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -363,8 +363,22 @@ // Enable this option for Toshiba steppers //#define CONFIG_STEPPERS_TOSHIBA +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + // @section homing +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + // coarse Endstop Settings #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors @@ -387,8 +401,6 @@ const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -#define DISABLE_MAX_ENDSTOPS -//#define DISABLE_MIN_ENDSTOPS //=========================================================================== //============================= Z Probe Options ============================= diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 80e9d35190..487e8d8764 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -346,8 +346,22 @@ // Enable this option for Toshiba steppers //#define CONFIG_STEPPERS_TOSHIBA +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + // @section homing +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + // coarse Endstop Settings #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors @@ -370,8 +384,6 @@ const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -//#define DISABLE_MAX_ENDSTOPS -//#define DISABLE_MIN_ENDSTOPS //=========================================================================== //============================= Z Probe Options ============================= diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 3147bb0e0c..e5c98d4791 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -340,8 +340,22 @@ // Enable this option for Toshiba steppers //#define CONFIG_STEPPERS_TOSHIBA +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + // @section homing +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + // coarse Endstop Settings #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors @@ -364,8 +378,6 @@ const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -//#define DISABLE_MAX_ENDSTOPS -//#define DISABLE_MIN_ENDSTOPS //=========================================================================== //============================= Z Probe Options ============================= diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 2320abc067..c09a7ae820 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -354,8 +354,22 @@ // Enable this option for Toshiba steppers //#define CONFIG_STEPPERS_TOSHIBA +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + // @section homing +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +//#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +#define USE_ZMAX_PLUG + // coarse Endstop Settings //#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors @@ -378,8 +392,6 @@ const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -//#define DISABLE_MAX_ENDSTOPS -//#define DISABLE_MIN_ENDSTOPS //=========================================================================== //============================= Z Probe Options ============================= diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 8c7fb0388c..7dd94b7ae5 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -367,8 +367,22 @@ // Enable this option for Toshiba steppers //#define CONFIG_STEPPERS_TOSHIBA +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + // @section homing +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + // coarse Endstop Settings #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors @@ -391,8 +405,6 @@ const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -#define DISABLE_MAX_ENDSTOPS -//#define DISABLE_MIN_ENDSTOPS //=========================================================================== //============================= Z Probe Options ============================= diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 9d6c5b7f2d..6f96bbf422 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -338,8 +338,22 @@ // Enable this option for Toshiba steppers //#define CONFIG_STEPPERS_TOSHIBA +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + // @section homing +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + // coarse Endstop Settings #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors @@ -362,8 +376,6 @@ const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -//#define DISABLE_MAX_ENDSTOPS -//#define DISABLE_MIN_ENDSTOPS //=========================================================================== //============================= Z Probe Options ============================= diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 8effe9d891..9620b49ffa 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -346,8 +346,22 @@ // Enable this option for Toshiba steppers //#define CONFIG_STEPPERS_TOSHIBA +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + // @section homing +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + // coarse Endstop Settings #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors @@ -370,8 +384,6 @@ const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -//#define DISABLE_MAX_ENDSTOPS -//#define DISABLE_MIN_ENDSTOPS //=========================================================================== //============================= Z Probe Options ============================= diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 647ef1258c..58c2240c36 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -381,8 +381,22 @@ // Enable this option for Toshiba steppers //#define CONFIG_STEPPERS_TOSHIBA +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + // @section homing +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +//#define USE_XMIN_PLUG +//#define USE_YMIN_PLUG +//#define USE_ZMIN_PLUG +#define USE_XMAX_PLUG +#define USE_YMAX_PLUG +#define USE_ZMAX_PLUG + // coarse Endstop Settings #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors @@ -405,8 +419,6 @@ const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -//#define DISABLE_MAX_ENDSTOPS -#define DISABLE_MIN_ENDSTOPS // Deltas only use min endstops for probing. //=========================================================================== //============================= Z Probe Options ============================= diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 93d7f8ad7d..5beb3f4b54 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -381,8 +381,22 @@ // Enable this option for Toshiba steppers //#define CONFIG_STEPPERS_TOSHIBA +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + // @section homing +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +//#define USE_XMIN_PLUG +//#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG // a Z probe +#define USE_XMAX_PLUG +#define USE_YMAX_PLUG +#define USE_ZMAX_PLUG + // coarse Endstop Settings #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors @@ -405,8 +419,6 @@ const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -//#define DISABLE_MAX_ENDSTOPS -#define DISABLE_MIN_ENDSTOPS // Deltas only use min endstops for probing. //=========================================================================== //============================= Z Probe Options ============================= diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index cde4707f30..d88d12dc6e 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -381,8 +381,22 @@ // Enable this option for Toshiba steppers //#define CONFIG_STEPPERS_TOSHIBA +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + // @section homing +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +//#define USE_XMIN_PLUG +//#define USE_YMIN_PLUG +//#define USE_ZMIN_PLUG +#define USE_XMAX_PLUG +#define USE_YMAX_PLUG +#define USE_ZMAX_PLUG + // coarse Endstop Settings #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors @@ -405,8 +419,6 @@ const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -//#define DISABLE_MAX_ENDSTOPS -//#define DISABLE_MIN_ENDSTOPS // Deltas only use min endstops for probing. //=========================================================================== //============================= Z Probe Options ============================= diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 5255b7accc..6d769fb329 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -370,8 +370,22 @@ // Enable this option for Toshiba steppers //#define CONFIG_STEPPERS_TOSHIBA +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + // @section homing +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +//#define USE_XMIN_PLUG +//#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG // a Z probe +#define USE_XMAX_PLUG +#define USE_YMAX_PLUG +#define USE_ZMAX_PLUG + // coarse Endstop Settings #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors @@ -394,8 +408,6 @@ const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -//#define DISABLE_MAX_ENDSTOPS -//#define DISABLE_MIN_ENDSTOPS // Deltas only use min endstops for probing. //=========================================================================== //============================= Z Probe Options ============================= diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index bd550066c7..6ccd700aa6 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -349,8 +349,22 @@ // Enable this option for Toshiba steppers //#define CONFIG_STEPPERS_TOSHIBA +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + // @section homing +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + // coarse Endstop Settings #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors @@ -373,8 +387,6 @@ const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. -//#define DISABLE_MAX_ENDSTOPS -//#define DISABLE_MIN_ENDSTOPS //=========================================================================== //============================= Z Probe Options ============================= diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index b7431e9d25..85f2258f4d 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -336,8 +336,22 @@ // Enable this option for Toshiba steppers #define CONFIG_STEPPERS_TOSHIBA +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + // @section homing +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + // coarse Endstop Settings #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors @@ -360,8 +374,6 @@ const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -//#define DISABLE_MAX_ENDSTOPS -//#define DISABLE_MIN_ENDSTOPS //=========================================================================== //============================= Z Probe Options ============================= diff --git a/Marlin/pins.h b/Marlin/pins.h index 4afa2b6160..eb37f87af9 100644 --- a/Marlin/pins.h +++ b/Marlin/pins.h @@ -209,55 +209,37 @@ #endif #endif -#if ENABLED(DISABLE_MAX_ENDSTOPS) - #undef X_MAX_PIN - #undef Y_MAX_PIN - #undef Z_MAX_PIN - #define X_MAX_PIN -1 - #define Y_MAX_PIN -1 - #define Z_MAX_PIN -1 -#endif - -#if ENABLED(DISABLE_MIN_ENDSTOPS) - #undef X_MIN_PIN - #undef Y_MIN_PIN - #undef Z_MIN_PIN - #define X_MIN_PIN -1 - #define Y_MIN_PIN -1 - #define Z_MIN_PIN -1 -#endif - #if ENABLED(DISABLE_Z_MIN_PROBE_ENDSTOP) || DISABLED(Z_MIN_PROBE_ENDSTOP) // Allow code to compile regardless of Z_MIN_PROBE_ENDSTOP setting. #undef Z_MIN_PROBE_PIN #define Z_MIN_PROBE_PIN -1 #endif -#if ENABLED(DISABLE_XMAX_ENDSTOP) +#if DISABLED(USE_XMAX_PLUG) #undef X_MAX_PIN #define X_MAX_PIN -1 #endif -#if ENABLED(DISABLE_XMIN_ENDSTOP) - #undef X_MIN_PIN - #define X_MIN_PIN -1 -#endif - -#if ENABLED(DISABLE_YMAX_ENDSTOP) +#if DISABLED(USE_YMAX_PLUG) #undef Y_MAX_PIN #define Y_MAX_PIN -1 #endif -#if ENABLED(DISABLE_YMIN_ENDSTOP) - #undef Y_MIN_PIN - #define Y_MIN_PIN -1 -#endif - -#if ENABLED(DISABLE_ZMAX_ENDSTOP) +#if DISABLED(USE_ZMAX_PLUG) #undef Z_MAX_PIN #define Z_MAX_PIN -1 #endif -#if ENABLED(DISABLE_ZMIN_ENDSTOP) +#if DISABLED(USE_XMIN_PLUG) + #undef X_MIN_PIN + #define X_MIN_PIN -1 +#endif + +#if DISABLED(USE_YMIN_PLUG) + #undef Y_MIN_PIN + #define Y_MIN_PIN -1 +#endif + +#if DISABLED(USE_ZMIN_PLUG) #undef Z_MIN_PIN #define Z_MIN_PIN -1 #endif diff --git a/Marlin/pins_FELIX2.h b/Marlin/pins_FELIX2.h index 79d8332ada..e5aa87922b 100644 --- a/Marlin/pins_FELIX2.h +++ b/Marlin/pins_FELIX2.h @@ -29,8 +29,6 @@ #undef HEATER_1_PIN #define HEATER_1_PIN 7 // EXTRUDER 2 -#define DISABLE_MAX_ENDSTOPS - #undef SDPOWER #define SDPOWER 1 From 868eebfdeee0a0d00d35496ae95baa7e8258b278 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 2 Mar 2016 02:05:21 -0800 Subject: [PATCH 3/5] Simplify configuration of Z2 endstops --- Marlin/Conditionals.h | 41 +++++++++++++++++++ Marlin/Configuration_adv.h | 4 +- Marlin/SanityCheck.h | 2 + .../Felix/Configuration_adv.h | 4 +- .../Hephestos/Configuration_adv.h | 4 +- .../Hephestos_2/Configuration_adv.h | 4 +- .../K8200/Configuration_adv.h | 4 +- .../RigidBot/Configuration_adv.h | 4 +- .../SCARA/Configuration_adv.h | 4 +- .../TAZ4/Configuration_adv.h | 4 +- .../WITBOX/Configuration_adv.h | 4 +- .../delta/biv2.5/Configuration_adv.h | 4 +- .../delta/generic/Configuration_adv.h | 4 +- .../delta/kossel_mini/Configuration_adv.h | 4 +- .../delta/kossel_pro/Configuration_adv.h | 4 +- .../delta/kossel_xl/Configuration_adv.h | 4 +- .../makibox/Configuration_adv.h | 4 +- .../tvrrug/Round2/Configuration_adv.h | 4 +- 18 files changed, 59 insertions(+), 48 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 7e6e64c915..146565b4f0 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -503,6 +503,47 @@ #define ARRAY_BY_EXTRUDERS1(v1) ARRAY_BY_EXTRUDERS(v1, v1, v1, v1) + /** + * Z_DUAL_ENDSTOPS endstop reassignment + */ + #if ENABLED(Z_DUAL_ENDSTOPS) + #define _XMIN_ 100 + #define _YMIN_ 200 + #define _ZMIN_ 300 + #define _XMAX_ 101 + #define _YMAX_ 201 + #define _ZMAX_ 301 + const bool Z2_MAX_ENDSTOP_INVERTING = + #if Z2_USE_ENDSTOP == _XMAX_ + X_MAX_ENDSTOP_INVERTING + #define Z2_MAX_PIN X_MAX_PIN + #undef USE_XMAX_PLUG + #elif Z2_USE_ENDSTOP == _YMAX_ + Y_MAX_ENDSTOP_INVERTING + #define Z2_MAX_PIN Y_MAX_PIN + #undef USE_YMAX_PLUG + #elif Z2_USE_ENDSTOP == _ZMAX_ + Z_MAX_ENDSTOP_INVERTING + #define Z2_MAX_PIN Z_MAX_PIN + #undef USE_ZMAX_PLUG + #elif Z2_USE_ENDSTOP == _XMIN_ + X_MIN_ENDSTOP_INVERTING + #define Z2_MAX_PIN X_MIN_PIN + #undef USE_XMIN_PLUG + #elif Z2_USE_ENDSTOP == _YMIN_ + Y_MIN_ENDSTOP_INVERTING + #define Z2_MAX_PIN Y_MIN_PIN + #undef USE_YMIN_PLUG + #elif Z2_USE_ENDSTOP == _ZMIN_ + Z_MIN_ENDSTOP_INVERTING + #define Z2_MAX_PIN Z_MIN_PIN + #undef USE_ZMIN_PLUG + #else + 0 + #endif + ; + #endif + /** * Shorthand for pin tests, used wherever needed */ diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 84f001fb81..4dd7739d2f 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -201,9 +201,7 @@ //#define Z_DUAL_ENDSTOPS #if ENABLED(Z_DUAL_ENDSTOPS) - #define Z2_MAX_PIN 36 //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36) - const bool Z2_MAX_ENDSTOP_INVERTING = false; - #define DISABLE_XMAX_ENDSTOP //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis. + #define Z2_USE_ENDSTOP _XMAX_ #endif #endif // Z_DUAL_STEPPER_DRIVERS diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index c1edb4a5b4..8487792d2a 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -469,6 +469,8 @@ #error FILAMENT_SENSOR is deprecated. Use FILAMENT_WIDTH_SENSOR instead. #elif defined(DISABLE_MAX_ENDSTOPS) || defined(DISABLE_MIN_ENDSTOPS) #error DISABLE_MAX_ENDSTOPS and DISABLE_MIN_ENDSTOPS deprecated - set USE_*_ENDSTOP flags instead +#elif ENABLED(Z_DUAL_ENDSTOPS) && !defined(Z2_USE_ENDSTOP) + #error Z_DUAL_ENDSTOPS settings are simplified. Just set Z2_USE_ENDSTOP to the endstop you want to repurpose for Z2 #endif #endif //SANITYCHECK_H diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index 5608d4b393..d5b2942d64 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -201,9 +201,7 @@ //#define Z_DUAL_ENDSTOPS #if ENABLED(Z_DUAL_ENDSTOPS) - #define Z2_MAX_PIN 36 //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36) - const bool Z2_MAX_ENDSTOP_INVERTING = false; - #define DISABLE_XMAX_ENDSTOP //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis. + #define Z2_USE_ENDSTOP _XMAX_ #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 fcdee236a9..b92a737983 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -201,9 +201,7 @@ //#define Z_DUAL_ENDSTOPS #if ENABLED(Z_DUAL_ENDSTOPS) - #define Z2_MAX_PIN 36 //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36) - const bool Z2_MAX_ENDSTOP_INVERTING = false; - #define DISABLE_XMAX_ENDSTOP //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis. + #define Z2_USE_ENDSTOP _XMAX_ #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 3131e10b24..b5a451c53f 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h @@ -201,9 +201,7 @@ //#define Z_DUAL_ENDSTOPS #if ENABLED(Z_DUAL_ENDSTOPS) - #define Z2_MAX_PIN 36 //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36) - const bool Z2_MAX_ENDSTOP_INVERTING = false; - #define DISABLE_XMAX_ENDSTOP //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis. + #define Z2_USE_ENDSTOP _XMAX_ #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 f5b6e70ea6..5c47bde71b 100644 --- a/Marlin/example_configurations/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/K8200/Configuration_adv.h @@ -207,9 +207,7 @@ //#define Z_DUAL_ENDSTOPS #if ENABLED(Z_DUAL_ENDSTOPS) - #define Z2_MAX_PIN 36 //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36) - const bool Z2_MAX_ENDSTOP_INVERTING = false; - #define DISABLE_XMAX_ENDSTOP //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis. + #define Z2_USE_ENDSTOP _XMAX_ #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 c93dde2814..17e19b0839 100644 --- a/Marlin/example_configurations/RigidBot/Configuration_adv.h +++ b/Marlin/example_configurations/RigidBot/Configuration_adv.h @@ -201,9 +201,7 @@ //#define Z_DUAL_ENDSTOPS #if ENABLED(Z_DUAL_ENDSTOPS) - #define Z2_MAX_PIN 36 //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36) - const bool Z2_MAX_ENDSTOP_INVERTING = false; - #define DISABLE_XMAX_ENDSTOP //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis. + #define Z2_USE_ENDSTOP _XMAX_ #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 627067d775..1b09057ed8 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -201,9 +201,7 @@ //#define Z_DUAL_ENDSTOPS #if ENABLED(Z_DUAL_ENDSTOPS) - #define Z2_MAX_PIN 36 //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36) - const bool Z2_MAX_ENDSTOP_INVERTING = false; - #define DISABLE_XMAX_ENDSTOP //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis. + #define Z2_USE_ENDSTOP _XMAX_ #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 c052253a10..62dde979c8 100644 --- a/Marlin/example_configurations/TAZ4/Configuration_adv.h +++ b/Marlin/example_configurations/TAZ4/Configuration_adv.h @@ -209,9 +209,7 @@ //#define Z_DUAL_ENDSTOPS #if ENABLED(Z_DUAL_ENDSTOPS) - #define Z2_MAX_PIN 36 //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36) - const bool Z2_MAX_ENDSTOP_INVERTING = false; - #define DISABLE_XMAX_ENDSTOP //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis. + #define Z2_USE_ENDSTOP _XMAX_ #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 fcdee236a9..b92a737983 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -201,9 +201,7 @@ //#define Z_DUAL_ENDSTOPS #if ENABLED(Z_DUAL_ENDSTOPS) - #define Z2_MAX_PIN 36 //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36) - const bool Z2_MAX_ENDSTOP_INVERTING = false; - #define DISABLE_XMAX_ENDSTOP //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis. + #define Z2_USE_ENDSTOP _XMAX_ #endif #endif // Z_DUAL_STEPPER_DRIVERS diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h index 85734dc416..491cf38f33 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h @@ -201,9 +201,7 @@ //#define Z_DUAL_ENDSTOPS #if ENABLED(Z_DUAL_ENDSTOPS) - #define Z2_MAX_PIN 36 //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36) - const bool Z2_MAX_ENDSTOP_INVERTING = false; - #define DISABLE_XMAX_ENDSTOP //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis. + #define Z2_USE_ENDSTOP _XMAX_ #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 006502e7a5..414d4de32d 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -201,9 +201,7 @@ //#define Z_DUAL_ENDSTOPS #if ENABLED(Z_DUAL_ENDSTOPS) - #define Z2_MAX_PIN 36 //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36) - const bool Z2_MAX_ENDSTOP_INVERTING = false; - #define DISABLE_XMAX_ENDSTOP //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis. + #define Z2_USE_ENDSTOP _XMAX_ #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 4b93e46474..a9de9f43aa 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -201,9 +201,7 @@ //#define Z_DUAL_ENDSTOPS #if ENABLED(Z_DUAL_ENDSTOPS) - #define Z2_MAX_PIN 36 //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36) - const bool Z2_MAX_ENDSTOP_INVERTING = false; - #define DISABLE_XMAX_ENDSTOP //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis. + #define Z2_USE_ENDSTOP _XMAX_ #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 b3fec75c5a..29d9607ac1 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h @@ -206,9 +206,7 @@ //#define Z_DUAL_ENDSTOPS #if ENABLED(Z_DUAL_ENDSTOPS) - #define Z2_MAX_PIN 36 //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36) - const bool Z2_MAX_ENDSTOP_INVERTING = false; - #define DISABLE_XMAX_ENDSTOP //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis. + #define Z2_USE_ENDSTOP _XMAX_ #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 44e7942eb2..23829cbbc9 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h @@ -201,9 +201,7 @@ //#define Z_DUAL_ENDSTOPS #if ENABLED(Z_DUAL_ENDSTOPS) - #define Z2_MAX_PIN 36 //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36) - const bool Z2_MAX_ENDSTOP_INVERTING = false; - #define DISABLE_XMAX_ENDSTOP //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis. + #define Z2_USE_ENDSTOP _XMAX_ #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 9b131b3298..301f362b67 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -201,9 +201,7 @@ //#define Z_DUAL_ENDSTOPS #if ENABLED(Z_DUAL_ENDSTOPS) - #define Z2_MAX_PIN 36 //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36) - const bool Z2_MAX_ENDSTOP_INVERTING = false; - #define DISABLE_XMAX_ENDSTOP //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis. + #define Z2_USE_ENDSTOP _XMAX_ #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 37d3bd81e2..0c62e79118 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -201,9 +201,7 @@ //#define Z_DUAL_ENDSTOPS #if ENABLED(Z_DUAL_ENDSTOPS) - #define Z2_MAX_PIN 36 //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36) - const bool Z2_MAX_ENDSTOP_INVERTING = false; - #define DISABLE_XMAX_ENDSTOP //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis. + #define Z2_USE_ENDSTOP _XMAX_ #endif #endif // Z_DUAL_STEPPER_DRIVERS From a617d12f706e290925f7f9fdf426751482180608 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 2 Mar 2016 21:06:15 -0800 Subject: [PATCH 4/5] Account for Z_DUAL_ENDSTOPS in sanity checking of endstops --- Marlin/SanityCheck.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 8487792d2a..5e74ec93bc 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -422,12 +422,14 @@ /** * Endstops */ -#if DISABLED(HAS_ENDSTOP_X_MIN) && DISABLED(HAS_ENDSTOP_X_MAX) - #error You must enable HAS_ENDSTOP_X_MIN or HAS_ENDSTOP_X_MAX -#elif DISABLED(HAS_ENDSTOP_Y_MIN) && DISABLED(HAS_ENDSTOP_Y_MAX) - #error You must enable HAS_ENDSTOP_Y_MIN or HAS_ENDSTOP_Y_MAX -#elif DISABLED(HAS_ENDSTOP_Z_MIN) && DISABLED(HAS_ENDSTOP_Z_MAX) - #error You must enable HAS_ENDSTOP_Z_MIN or HAS_ENDSTOP_Z_MAX +#if DISABLED(USE_XMIN_PLUG) && DISABLED(USE_XMAX_PLUG) && !(ENABLED(Z_DUAL_ENDSTOPS) && Z2_USE_ENDSTOP >= _XMAX_ && Z2_USE_ENDSTOP <= _XMIN_) + #error You must enable USE_XMIN_PLUG or USE_XMAX_PLUG +#elif DISABLED(USE_YMIN_PLUG) && DISABLED(USE_YMAX_PLUG) && !(ENABLED(Z_DUAL_ENDSTOPS) && Z2_USE_ENDSTOP >= _YMAX_ && Z2_USE_ENDSTOP <= _YMIN_) + #error You must enable USE_YMIN_PLUG or USE_YMAX_PLUG +#elif DISABLED(USE_ZMIN_PLUG) && DISABLED(USE_ZMAX_PLUG) && !(ENABLED(Z_DUAL_ENDSTOPS) && Z2_USE_ENDSTOP >= _ZMAX_ && Z2_USE_ENDSTOP <= _ZMIN_) + #error You must enable USE_ZMIN_PLUG or USE_ZMAX_PLUG +#elif ENABLED(Z_DUAL_ENDSTOPS) && !Z2_USE_ENDSTOP + #error You must set Z2_USE_ENDSTOP with Z_DUAL_ENDSTOPS #endif /** @@ -468,7 +470,7 @@ #elif defined(FILAMENT_SENSOR) #error FILAMENT_SENSOR is deprecated. Use FILAMENT_WIDTH_SENSOR instead. #elif defined(DISABLE_MAX_ENDSTOPS) || defined(DISABLE_MIN_ENDSTOPS) - #error DISABLE_MAX_ENDSTOPS and DISABLE_MIN_ENDSTOPS deprecated - set USE_*_ENDSTOP flags instead + #error DISABLE_MAX_ENDSTOPS and DISABLE_MIN_ENDSTOPS deprecated. Use individual USE_*_PLUG options instead. #elif ENABLED(Z_DUAL_ENDSTOPS) && !defined(Z2_USE_ENDSTOP) #error Z_DUAL_ENDSTOPS settings are simplified. Just set Z2_USE_ENDSTOP to the endstop you want to repurpose for Z2 #endif From 2b4c42610c5aa445107774333cdf239925b66ba3 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 24 Mar 2016 02:46:57 -0700 Subject: [PATCH 5/5] Adjust SanityCheck messages --- Marlin/SanityCheck.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 5e74ec93bc..75bb4893ad 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -458,13 +458,13 @@ #elif defined(CUSTOM_MENDEL_NAME) #error CUSTOM_MENDEL_NAME is now CUSTOM_MACHINE_NAME. Please update your configuration. #elif defined(HAS_AUTOMATIC_VERSIONING) - #error HAS_AUTOMATIC_VERSIONING deprecated - use USE_AUTOMATIC_VERSIONING instead + #error HAS_AUTOMATIC_VERSIONING is now USE_AUTOMATIC_VERSIONING. Please update your configuration. #elif defined(ENABLE_AUTO_BED_LEVELING) - #error ENABLE_AUTO_BED_LEVELING deprecated - use AUTO_BED_LEVELING_FEATURE instead + #error ENABLE_AUTO_BED_LEVELING is now AUTO_BED_LEVELING_FEATURE. Please update your configuration. #elif defined(SDSLOW) - #error SDSLOW deprecated - set SPI_SPEED to SPI_HALF_SPEED instead + #error SDSLOW deprecated. Set SPI_SPEED to SPI_HALF_SPEED instead. #elif defined(SDEXTRASLOW) - #error SDEXTRASLOW deprecated - set SPI_SPEED to SPI_QUARTER_SPEED instead + #error SDEXTRASLOW deprecated. Set SPI_SPEED to SPI_QUARTER_SPEED instead. #elif defined(Z_RAISE_BEFORE_HOMING) #error Z_RAISE_BEFORE_HOMING is deprecated. Use MIN_Z_HEIGHT_FOR_HOMING instead. #elif defined(FILAMENT_SENSOR)