From 671634bf1111ab0cf3bf06f9284a791a46472882 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 14 Jul 2016 16:05:37 -0700 Subject: [PATCH 1/5] Fix spacing after section header --- Marlin/Configuration.h | 1 + Marlin/example_configurations/Cartesio/Configuration.h | 1 + Marlin/example_configurations/Felix/Configuration.h | 1 + Marlin/example_configurations/Felix/DUAL/Configuration.h | 1 + Marlin/example_configurations/Hephestos/Configuration.h | 1 + Marlin/example_configurations/Hephestos_2/Configuration.h | 1 + Marlin/example_configurations/K8200/Configuration.h | 1 + Marlin/example_configurations/K8400/Configuration.h | 1 + Marlin/example_configurations/K8400/Dual-head/Configuration.h | 1 + .../RepRapWorld/Megatronics/Configuration.h | 1 + Marlin/example_configurations/RigidBot/Configuration.h | 1 + Marlin/example_configurations/SCARA/Configuration.h | 1 + Marlin/example_configurations/TAZ4/Configuration.h | 1 + Marlin/example_configurations/WITBOX/Configuration.h | 1 + Marlin/example_configurations/adafruit/ST7565/Configuration.h | 1 + Marlin/example_configurations/delta/biv2.5/Configuration.h | 1 + Marlin/example_configurations/delta/generic/Configuration.h | 1 + Marlin/example_configurations/delta/kossel_mini/Configuration.h | 1 + Marlin/example_configurations/delta/kossel_pro/Configuration.h | 1 + Marlin/example_configurations/delta/kossel_xl/Configuration.h | 1 + Marlin/example_configurations/makibox/Configuration.h | 1 + Marlin/example_configurations/tvrrug/Round2/Configuration.h | 1 + 22 files changed, 22 insertions(+) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index fb59131b2..0a6d77417 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -596,6 +596,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define INVERT_E3_DIR false // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index a61f51b29..5d23fb537 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -596,6 +596,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define INVERT_E3_DIR false // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 4ad34b019..2bb499f0c 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -578,6 +578,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define INVERT_E3_DIR false // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index c1467c53f..5fc495f24 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -576,6 +576,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define INVERT_E3_DIR false // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 9d132ad05..fa58bb394 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -588,6 +588,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define INVERT_E3_DIR false // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 012df0680..ebdd18cb3 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -590,6 +590,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define INVERT_E3_DIR false // @section homing + #define MIN_Z_HEIGHT_FOR_HOMING 5 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index a4252f496..c20173daf 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -613,6 +613,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define INVERT_E3_DIR true // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index 3addb541c..e9e7a6b54 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -573,6 +573,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define INVERT_E3_DIR false // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/K8400/Dual-head/Configuration.h index 992912eb7..48f7f6008 100644 --- a/Marlin/example_configurations/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual-head/Configuration.h @@ -573,6 +573,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define INVERT_E3_DIR false // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 59b2c9db9..11a5a07f7 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -596,6 +596,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define INVERT_E3_DIR false // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 14c454780..c080bd9fc 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -593,6 +593,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define INVERT_E3_DIR false // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 92708015b..7a9f0d37c 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -604,6 +604,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define INVERT_E3_DIR false // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 700bc69c2..f51bc4841 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -617,6 +617,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define INVERT_E3_DIR true // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 7110d30ea..5abe59e1c 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -588,6 +588,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define INVERT_E3_DIR false // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 95428fc67..9f3fa954a 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -596,6 +596,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define INVERT_E3_DIR false // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 5a8faef98..d599e9a50 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -685,6 +685,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define INVERT_E3_DIR false // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 3118bf3af..cf5e08126 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -679,6 +679,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define INVERT_E3_DIR false // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 3d237ec2d..f2fdc54b0 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -682,6 +682,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define INVERT_E3_DIR false // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 15// (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 96c143f21..aca8ede55 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -676,6 +676,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define INVERT_E3_DIR false // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index a7e3f4edc..b59312fce 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -677,6 +677,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define INVERT_E3_DIR false // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 6a5a8c24c..4d05e5cb7 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -599,6 +599,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l #define INVERT_E3_DIR false // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 5f27ebd05..787de288b 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -586,6 +586,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo #define INVERT_E3_DIR false // @section homing + //#define MIN_Z_HEIGHT_FOR_HOMING 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. From 0fcd3706dd3365b66efda7d3ba8a6a0edb121a3a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 14 Jul 2016 16:11:53 -0700 Subject: [PATCH 2/5] Replace ENDSTOPS_ONLY_FOR_HOMING with ENDSTOPS_ALWAYS_ON_DEFAULT --- Marlin/Configuration_adv.h | 5 +++-- Marlin/SanityCheck.h | 2 ++ Marlin/endstops.cpp | 12 ++++++------ .../Cartesio/Configuration_adv.h | 5 +++-- .../example_configurations/Felix/Configuration_adv.h | 5 +++-- .../Hephestos/Configuration_adv.h | 5 +++-- .../Hephestos_2/Configuration_adv.h | 5 +++-- .../example_configurations/K8200/Configuration_adv.h | 5 +++-- .../example_configurations/K8400/Configuration_adv.h | 5 +++-- .../RigidBot/Configuration_adv.h | 5 +++-- .../example_configurations/SCARA/Configuration_adv.h | 5 +++-- .../example_configurations/TAZ4/Configuration_adv.h | 5 +++-- .../WITBOX/Configuration_adv.h | 5 +++-- .../delta/biv2.5/Configuration_adv.h | 5 +++-- .../delta/generic/Configuration_adv.h | 5 +++-- .../delta/kossel_mini/Configuration_adv.h | 5 +++-- .../delta/kossel_pro/Configuration_adv.h | 5 +++-- .../delta/kossel_xl/Configuration_adv.h | 5 +++-- .../makibox/Configuration_adv.h | 5 +++-- .../tvrrug/Round2/Configuration_adv.h | 5 +++-- 20 files changed, 62 insertions(+), 42 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 027132d77..930e931d3 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -223,7 +223,9 @@ // @section homing -#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT // @section extras @@ -439,7 +441,6 @@ // This option allows you to abort SD printing when any endstop is triggered. // This feature must be enabled with "M540 S1" or from the LCD menu. // To have any effect, endstops must be enabled during SD printing. - // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #endif // SDSUPPORT diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 98abffa0a..086634491 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -680,6 +680,8 @@ #error "ABS_PREHEAT_HPB_TEMP is now PREHEAT_2_TEMP_BED. Please update your configuration." #elif defined(ABS_PREHEAT_FAN_SPEED) #error "ABS_PREHEAT_FAN_SPEED is now PREHEAT_2_FAN_SPEED. Please update your configuration." +#elif defined(ENDSTOPS_ONLY_FOR_HOMING) + #error "ENDSTOPS_ONLY_FOR_HOMING is deprecated. Use (disable) ENDSTOPS_ALWAYS_ON_DEFAULT instead." #endif /** diff --git a/Marlin/endstops.cpp b/Marlin/endstops.cpp index 3bfb67a11..9eec4a579 100644 --- a/Marlin/endstops.cpp +++ b/Marlin/endstops.cpp @@ -40,10 +40,10 @@ Endstops endstops; bool Endstops::enabled = true, Endstops::enabled_globally = - #if ENABLED(ENDSTOPS_ONLY_FOR_HOMING) - false + #if ENABLED(ENDSTOPS_ALWAYS_ON_DEFAULT) + (true) #else - true + (false) #endif ; volatile char Endstops::endstop_hit_bits; // use X_MIN, Y_MIN, Z_MIN and Z_MIN_PROBE as BIT value @@ -66,10 +66,10 @@ volatile char Endstops::endstop_hit_bits; // use X_MIN, Y_MIN, Z_MIN and Z_MIN_P Endstops::Endstops() { enable_globally( - #if ENABLED(ENDSTOPS_ONLY_FOR_HOMING) - false + #if ENABLED(ENDSTOPS_ALWAYS_ON_DEFAULT) + (true) #else - true + (false) #endif ); enable(true); diff --git a/Marlin/example_configurations/Cartesio/Configuration_adv.h b/Marlin/example_configurations/Cartesio/Configuration_adv.h index 5fb71efe6..9207b5703 100644 --- a/Marlin/example_configurations/Cartesio/Configuration_adv.h +++ b/Marlin/example_configurations/Cartesio/Configuration_adv.h @@ -223,7 +223,9 @@ // @section homing -#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT // @section extras @@ -439,7 +441,6 @@ // This option allows you to abort SD printing when any endstop is triggered. // This feature must be enabled with "M540 S1" or from the LCD menu. // To have any effect, endstops must be enabled during SD printing. - // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #endif // SDSUPPORT diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index 05189ecfc..3f0729b6c 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -223,7 +223,9 @@ // @section homing -#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT // @section extras @@ -439,7 +441,6 @@ // This option allows you to abort SD printing when any endstop is triggered. // This feature must be enabled with "M540 S1" or from the LCD menu. // To have any effect, endstops must be enabled during SD printing. - // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #endif // SDSUPPORT diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h index 1aa7c218b..af6bce805 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -223,7 +223,9 @@ // @section homing -//#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +#define ENDSTOPS_ALWAYS_ON_DEFAULT // @section extras @@ -439,7 +441,6 @@ // This option allows you to abort SD printing when any endstop is triggered. // This feature must be enabled with "M540 S1" or from the LCD menu. // To have any effect, endstops must be enabled during SD printing. - // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #endif // SDSUPPORT diff --git a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h index 95b8c89b8..bfb6b16c7 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h @@ -223,7 +223,9 @@ // @section homing -#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT // @section extras @@ -439,7 +441,6 @@ // This option allows you to abort SD printing when any endstop is triggered. // This feature must be enabled with "M540 S1" or from the LCD menu. // To have any effect, endstops must be enabled during SD printing. - // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #endif // SDSUPPORT diff --git a/Marlin/example_configurations/K8200/Configuration_adv.h b/Marlin/example_configurations/K8200/Configuration_adv.h index 2d0afdff3..3703ce1cc 100644 --- a/Marlin/example_configurations/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/K8200/Configuration_adv.h @@ -229,7 +229,9 @@ // @section homing -#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT // @section extras @@ -445,7 +447,6 @@ // This option allows you to abort SD printing when any endstop is triggered. // This feature must be enabled with "M540 S1" or from the LCD menu. // To have any effect, endstops must be enabled during SD printing. - // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #endif // SDSUPPORT diff --git a/Marlin/example_configurations/K8400/Configuration_adv.h b/Marlin/example_configurations/K8400/Configuration_adv.h index ba78a1589..11fdbdb3c 100644 --- a/Marlin/example_configurations/K8400/Configuration_adv.h +++ b/Marlin/example_configurations/K8400/Configuration_adv.h @@ -223,7 +223,9 @@ // @section homing -#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT // @section extras @@ -439,7 +441,6 @@ // This option allows you to abort SD printing when any endstop is triggered. // This feature must be enabled with "M540 S1" or from the LCD menu. // To have any effect, endstops must be enabled during SD printing. - // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #endif // SDSUPPORT diff --git a/Marlin/example_configurations/RigidBot/Configuration_adv.h b/Marlin/example_configurations/RigidBot/Configuration_adv.h index e3af83bad..3c0968260 100644 --- a/Marlin/example_configurations/RigidBot/Configuration_adv.h +++ b/Marlin/example_configurations/RigidBot/Configuration_adv.h @@ -223,7 +223,9 @@ // @section homing -#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT // @section extras @@ -439,7 +441,6 @@ // This option allows you to abort SD printing when any endstop is triggered. // This feature must be enabled with "M540 S1" or from the LCD menu. // To have any effect, endstops must be enabled during SD printing. - // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #endif // SDSUPPORT diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index a7285ffd2..6a0dea802 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -223,7 +223,9 @@ // @section homing -#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT // @section extras @@ -439,7 +441,6 @@ // This option allows you to abort SD printing when any endstop is triggered. // This feature must be enabled with "M540 S1" or from the LCD menu. // To have any effect, endstops must be enabled during SD printing. - // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #endif // SDSUPPORT diff --git a/Marlin/example_configurations/TAZ4/Configuration_adv.h b/Marlin/example_configurations/TAZ4/Configuration_adv.h index 116c99abb..fe9b6ba36 100644 --- a/Marlin/example_configurations/TAZ4/Configuration_adv.h +++ b/Marlin/example_configurations/TAZ4/Configuration_adv.h @@ -231,7 +231,9 @@ // @section homing -#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT // @section extras @@ -447,7 +449,6 @@ // This option allows you to abort SD printing when any endstop is triggered. // This feature must be enabled with "M540 S1" or from the LCD menu. // To have any effect, endstops must be enabled during SD printing. - // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #endif // SDSUPPORT diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h index 1aa7c218b..af6bce805 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -223,7 +223,9 @@ // @section homing -//#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +#define ENDSTOPS_ALWAYS_ON_DEFAULT // @section extras @@ -439,7 +441,6 @@ // This option allows you to abort SD printing when any endstop is triggered. // This feature must be enabled with "M540 S1" or from the LCD menu. // To have any effect, endstops must be enabled during SD printing. - // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #endif // SDSUPPORT diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h index 3e9fd8670..173cacf4d 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h @@ -223,7 +223,9 @@ // @section homing -#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT // @section extras @@ -441,7 +443,6 @@ // This option allows you to abort SD printing when any endstop is triggered. // This feature must be enabled with "M540 S1" or from the LCD menu. // To have any effect, endstops must be enabled during SD printing. - // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #endif // SDSUPPORT diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index 1dfeb8c71..51a2d2b0b 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -223,7 +223,9 @@ // @section homing -#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT // @section extras @@ -441,7 +443,6 @@ // This option allows you to abort SD printing when any endstop is triggered. // This feature must be enabled with "M540 S1" or from the LCD menu. // To have any effect, endstops must be enabled during SD printing. - // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #endif // SDSUPPORT diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index e2bb76476..90b3c68f0 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -223,7 +223,9 @@ // @section homing -#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT // @section extras @@ -440,7 +442,6 @@ // This option allows you to abort SD printing when any endstop is triggered. // This feature must be enabled with "M540 S1" or from the LCD menu. // To have any effect, endstops must be enabled during SD printing. - // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #endif // SDSUPPORT diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h index 3baf69390..b8b94f8d4 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h @@ -228,7 +228,9 @@ // @section homing -#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT // @section extras @@ -445,7 +447,6 @@ // This option allows you to abort SD printing when any endstop is triggered. // This feature must be enabled with "M540 S1" or from the LCD menu. // To have any effect, endstops must be enabled during SD printing. - // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #endif // SDSUPPORT diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h index 3b82e06fb..74bb7c5dc 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h @@ -223,7 +223,9 @@ // @section homing -#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT // @section extras @@ -441,7 +443,6 @@ // This option allows you to abort SD printing when any endstop is triggered. // This feature must be enabled with "M540 S1" or from the LCD menu. // To have any effect, endstops must be enabled during SD printing. - // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #endif // SDSUPPORT diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index bdf820937..6e8c6e671 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -223,7 +223,9 @@ // @section homing -#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT // @section extras @@ -439,7 +441,6 @@ // This option allows you to abort SD printing when any endstop is triggered. // This feature must be enabled with "M540 S1" or from the LCD menu. // To have any effect, endstops must be enabled during SD printing. - // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #endif // SDSUPPORT diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index 9c04c4650..f72daabc8 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -223,7 +223,9 @@ // @section homing -#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT // @section extras @@ -439,7 +441,6 @@ // This option allows you to abort SD printing when any endstop is triggered. // This feature must be enabled with "M540 S1" or from the LCD menu. // To have any effect, endstops must be enabled during SD printing. - // With ENDSTOPS_ONLY_FOR_HOMING you must send "M120" to enable endstops. //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #endif // SDSUPPORT From 69d60169419bb31756c96c047bcaf7b4d0df5f03 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 14 Jul 2016 16:12:20 -0700 Subject: [PATCH 3/5] Revert default state of endstops in M502 --- Marlin/configuration_store.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index 4cf9f5d36..b74cc8d35 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -127,6 +127,7 @@ */ #include "Marlin.h" #include "language.h" +#include "endstops.h" #include "planner.h" #include "temperature.h" #include "ultralcd.h" @@ -660,6 +661,14 @@ void Config_ResetDefault() { for (uint8_t q = 0; q < COUNT(filament_size); q++) filament_size[q] = DEFAULT_NOMINAL_FILAMENT_DIA; + endstops.enable_globally( + #if ENABLED(ENDSTOPS_ALWAYS_ON_DEFAULT) + (true) + #else + (false) + #endif + ); + Config_Postprocess(); SERIAL_ECHO_START; From 5ed1e7a464561d4d54ad9c408a4f7ac0a345232a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 14 Jul 2016 16:39:49 -0700 Subject: [PATCH 4/5] codenum => dwell_ms --- Marlin/Marlin_main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index e7355292f..8162d3ab1 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2728,18 +2728,18 @@ inline void gcode_G0_G1() { * G4: Dwell S or P */ inline void gcode_G4() { - millis_t codenum = 0; + millis_t dwell_ms = 0; - if (code_seen('P')) codenum = code_value_millis(); // milliseconds to wait - if (code_seen('S')) codenum = code_value_millis_from_seconds(); // seconds to wait + if (code_seen('P')) dwell_ms = code_value_millis(); // milliseconds to wait + if (code_seen('S')) dwell_ms = code_value_millis_from_seconds(); // seconds to wait stepper.synchronize(); refresh_cmd_timeout(); - codenum += previous_cmd_ms; // keep track of when we started waiting + dwell_ms += previous_cmd_ms; // keep track of when we started waiting if (!lcd_hasstatus()) LCD_MESSAGEPGM(MSG_DWELL); - while (PENDING(millis(), codenum)) idle(); + while (PENDING(millis(), dwell_ms)) idle(); } #if ENABLED(BEZIER_CURVE_SUPPORT) From 7242d4481061c5749aaf2f40ae26c6440239c6d2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 17 Jul 2016 13:34:30 -0700 Subject: [PATCH 5/5] Endstops vars already initialized --- Marlin/endstops.cpp | 14 -------------- Marlin/endstops.h | 2 +- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/Marlin/endstops.cpp b/Marlin/endstops.cpp index 9eec4a579..751296d40 100644 --- a/Marlin/endstops.cpp +++ b/Marlin/endstops.cpp @@ -64,20 +64,6 @@ volatile char Endstops::endstop_hit_bits; // use X_MIN, Y_MIN, Z_MIN and Z_MIN_P * Class and Instance Methods */ -Endstops::Endstops() { - enable_globally( - #if ENABLED(ENDSTOPS_ALWAYS_ON_DEFAULT) - (true) - #else - (false) - #endif - ); - enable(true); - #if HAS_BED_PROBE - enable_z_probe(false); - #endif -} // Endstops::Endstops - void Endstops::init() { #if HAS_X_MIN diff --git a/Marlin/endstops.h b/Marlin/endstops.h index 76b34862c..e5d541cf1 100644 --- a/Marlin/endstops.h +++ b/Marlin/endstops.h @@ -43,7 +43,7 @@ class Endstops { #endif current_endstop_bits, old_endstop_bits; - Endstops(); + Endstops() {}; /** * Initialize the endstop pins