Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENDSTOPS_ONLY_FOR_HOMING is confusing #4306

Merged
merged 5 commits into from
Jul 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
5 changes: 3 additions & 2 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2728,18 +2728,18 @@ inline void gcode_G0_G1() {
* G4: Dwell S<seconds> or P<milliseconds>
*/
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)
Expand Down
2 changes: 2 additions & 0 deletions Marlin/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

/**
Expand Down
9 changes: 9 additions & 0 deletions Marlin/configuration_store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
*/
#include "Marlin.h"
#include "language.h"
#include "endstops.h"
#include "planner.h"
#include "temperature.h"
#include "ultralcd.h"
Expand Down Expand Up @@ -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;
Expand Down
20 changes: 3 additions & 17 deletions Marlin/endstops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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_ONLY_FOR_HOMING)
false
#else
true
#endif
);
enable(true);
#if HAS_BED_PROBE
enable_z_probe(false);
#endif
} // Endstops::Endstops

void Endstops::init() {

#if HAS_X_MIN
Expand Down
2 changes: 1 addition & 1 deletion Marlin/endstops.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Endstops {
#endif
current_endstop_bits, old_endstop_bits;

Endstops();
Endstops() {};

/**
* Initialize the endstop pins
Expand Down
1 change: 1 addition & 0 deletions Marlin/example_configurations/Cartesio/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
5 changes: 3 additions & 2 deletions Marlin/example_configurations/Cartesio/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions Marlin/example_configurations/Felix/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
5 changes: 3 additions & 2 deletions Marlin/example_configurations/Felix/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions Marlin/example_configurations/Felix/DUAL/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
1 change: 1 addition & 0 deletions Marlin/example_configurations/Hephestos/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
5 changes: 3 additions & 2 deletions Marlin/example_configurations/Hephestos/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions Marlin/example_configurations/Hephestos_2/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
5 changes: 3 additions & 2 deletions Marlin/example_configurations/Hephestos_2/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions Marlin/example_configurations/K8200/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
5 changes: 3 additions & 2 deletions Marlin/example_configurations/K8200/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions Marlin/example_configurations/K8400/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
5 changes: 3 additions & 2 deletions Marlin/example_configurations/K8400/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
1 change: 1 addition & 0 deletions Marlin/example_configurations/RigidBot/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
5 changes: 3 additions & 2 deletions Marlin/example_configurations/RigidBot/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions Marlin/example_configurations/SCARA/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
5 changes: 3 additions & 2 deletions Marlin/example_configurations/SCARA/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions Marlin/example_configurations/TAZ4/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
5 changes: 3 additions & 2 deletions Marlin/example_configurations/TAZ4/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
Loading