From a7822e3ff7c204d081a6b7e7276564262ae71779 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Lefranc=CC=A7ois?= Date: Tue, 18 Aug 2015 09:52:04 -0400 Subject: [PATCH] Some renaming of Z_PROBE to Z_MIN_PROBE (PR#91) * Fix a couple of renames omission and macro expansion errors. --- Marlin/Conditionals.h | 4 ++-- Marlin/Marlin.h | 2 +- Marlin/SanityCheck.h | 8 ++++---- Marlin/configurator/config/Configuration.h | 2 +- .../example_configurations/Felix/Configuration.h | 2 +- .../Felix/Configuration_DUAL.h | 1 + .../Hephestos/Configuration.h | 2 +- .../example_configurations/K8200/Configuration.h | 2 +- .../RepRapWorld/Megatronics/Configuration.h | 2 +- .../RigidBot/Configuration.h | 2 +- .../example_configurations/SCARA/Configuration.h | 2 +- .../WITBOX/Configuration.h | 2 +- .../adafruit/ST7565/Configuration.h | 2 +- .../delta/biv2.5/Configuration.h | 2 +- .../delta/generic/Configuration.h | 2 +- .../delta/kossel_mini/Configuration.h | 2 +- .../delta/kossel_pro/Configuration.h | 2 +- .../makibox/Configuration.h | 2 +- .../tvrrug/Round2/Configuration.h | 2 +- Marlin/pins_AZTEEG_X3_PRO.h | 1 + Marlin/pins_RUMBA.h | 6 ++++++ Marlin/stepper.cpp | 16 ++++++++-------- 22 files changed, 38 insertions(+), 30 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 79c046c061..665ff45b31 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -239,7 +239,7 @@ #define ENDSTOPPULLUP_ZMIN #endif #if DISABLED(DISABLE_Z_MIN_PROBE_ENDSTOP) - #define ENDSTOPPULLUP_ZPROBE + #define ENDSTOPPULLUP_ZMIN_PROBE #endif #endif @@ -447,7 +447,7 @@ #define HAS_Z_MAX (PIN_EXISTS(Z_MAX)) #define HAS_Z2_MIN (PIN_EXISTS(Z2_MIN)) #define HAS_Z2_MAX (PIN_EXISTS(Z2_MAX)) - #define HAS_Z_PROBE (PIN_EXISTS(Z_PROBE)) + #define HAS_Z_PROBE (PIN_EXISTS(Z_MIN_PROBE)) #define HAS_SOLENOID_1 (PIN_EXISTS(SOL1)) #define HAS_SOLENOID_2 (PIN_EXISTS(SOL2)) #define HAS_SOLENOID_3 (PIN_EXISTS(SOL3)) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index bb5c4a9a8f..4c6ef0adb9 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -196,7 +196,7 @@ void manage_inactivity(bool ignore_stepper_queue=false); */ enum AxisEnum {X_AXIS=0, A_AXIS=0, Y_AXIS=1, B_AXIS=1, Z_AXIS=2, C_AXIS=2, E_AXIS=3, X_HEAD=4, Y_HEAD=5, Z_HEAD=5}; -enum EndstopEnum {X_MIN=0, Y_MIN=1, Z_MIN=2, Z_PROBE=3, X_MAX=4, Y_MAX=5, Z_MAX=6, Z2_MIN=7, Z2_MAX=8}; +enum EndstopEnum {X_MIN=0, Y_MIN=1, Z_MIN=2, Z_MIN_PROBE=3, X_MAX=4, Y_MAX=5, Z_MAX=6, Z2_MIN=7, Z2_MAX=8}; void enable_all_steppers(); void disable_all_steppers(); diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index dab240fff5..883f767835 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -132,8 +132,8 @@ /** * Require a Z Min pin */ - #if Z_MIN_PIN == -1 - #if Z_MIN_PROBE_PIN == -1 || (DISABLED(Z_MIN_PROBE_ENDSTOP) || ENABLED(DISABLE_Z_MIN_PROBE_ENDSTOP)) // It's possible for someone to set a pin for the Z Probe, but not enable it. + #if !PIN_EXISTS(Z_MIN) + #if !PIN_EXISTS(Z_MIN_PROBE) || (DISABLED(Z_MIN_PROBE_ENDSTOP) || ENABLED(DISABLE_Z_MIN_PROBE_ENDSTOP)) // It's possible for someone to set a pin for the Z Probe, but not enable it. #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) #error You must have a Z_MIN or Z_PROBE endstop to enable Z_MIN_PROBE_REPEATABILITY_TEST. #else @@ -146,10 +146,10 @@ * Require a Z Probe Pin if Z_MIN_PROBE_ENDSTOP is enabled. */ #if ENABLED(Z_MIN_PROBE_ENDSTOP) - #if !PIN_EXISTS(Z_PROBE) + #ifndef Z_MIN_PROBE_PIN #error You must have a Z_MIN_PROBE_PIN defined in your pins_XXXX.h file if you enable Z_MIN_PROBE_ENDSTOP. #endif - #if Z_MIN_PROBE_PIN == -1 + #if !PIN_EXISTS(Z_MIN_PROBE) #error You must set Z_MIN_PROBE_PIN to a valid pin if you enable Z_MIN_PROBE_ENDSTOP. #endif // Forcing Servo definitions can break some hall effect sensor setups. Leaving these here for further comment. diff --git a/Marlin/configurator/config/Configuration.h b/Marlin/configurator/config/Configuration.h index 6ec7eb6e90..827cfd2cee 100644 --- a/Marlin/configurator/config/Configuration.h +++ b/Marlin/configurator/config/Configuration.h @@ -327,7 +327,7 @@ Here are some standard links for getting your machine calibrated: // #define ENDSTOPPULLUP_XMIN // #define ENDSTOPPULLUP_YMIN // #define ENDSTOPPULLUP_ZMIN - // #define ENDSTOPPULLUP_ZPROBE + // #define ENDSTOPPULLUP_ZMIN_PROBE #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 8d00cd7f15..1984418ead 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -309,7 +309,7 @@ Here are some standard links for getting your machine calibrated: // #define ENDSTOPPULLUP_XMIN // #define ENDSTOPPULLUP_YMIN // #define ENDSTOPPULLUP_ZMIN - // #define ENDSTOPPULLUP_ZPROBE + // #define ENDSTOPPULLUP_ZMIN_PROBE #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). diff --git a/Marlin/example_configurations/Felix/Configuration_DUAL.h b/Marlin/example_configurations/Felix/Configuration_DUAL.h index 20243b90d3..ccccb19a7c 100644 --- a/Marlin/example_configurations/Felix/Configuration_DUAL.h +++ b/Marlin/example_configurations/Felix/Configuration_DUAL.h @@ -294,6 +294,7 @@ Here are some standard links for getting your machine calibrated: // #define ENDSTOPPULLUP_XMIN // #define ENDSTOPPULLUP_YMIN // #define ENDSTOPPULLUP_ZMIN + // #define ENDSTOPPULLUP_ZMIN_PROBE #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index e13e99ed87..adad1e6133 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -319,7 +319,7 @@ Here are some standard links for getting your machine calibrated: // #define ENDSTOPPULLUP_XMIN // #define ENDSTOPPULLUP_YMIN // #define ENDSTOPPULLUP_ZMIN - // #define ENDSTOPPULLUP_ZPROBE + // #define ENDSTOPPULLUP_ZMIN_PROBE #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 0f5d380361..055f461b75 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -315,7 +315,7 @@ Here are some standard links for getting your machine calibrated: #define ENDSTOPPULLUP_XMIN #define ENDSTOPPULLUP_YMIN #define ENDSTOPPULLUP_ZMIN - // #define ENDSTOPPULLUP_ZPROBE + // #define ENDSTOPPULLUP_ZMIN_PROBE #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index e5f0a7944c..04dcdcad31 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -327,7 +327,7 @@ Here are some standard links for getting your machine calibrated: // #define ENDSTOPPULLUP_XMIN // #define ENDSTOPPULLUP_YMIN // #define ENDSTOPPULLUP_ZMIN - // #define ENDSTOPPULLUP_ZPROBE + // #define ENDSTOPPULLUP_ZMIN_PROBE #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 0b78da7b1b..8b038cc1b0 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -313,7 +313,7 @@ Here are some standard links for getting your machine calibrated: // #define ENDSTOPPULLUP_XMIN // #define ENDSTOPPULLUP_YMIN // #define ENDSTOPPULLUP_ZMIN - // #define ENDSTOPPULLUP_ZPROBE + // #define ENDSTOPPULLUP_ZMIN_PROBE #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index e1fa45b240..c1e379b436 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -335,7 +335,7 @@ Here are some standard links for getting your machine calibrated: #define ENDSTOPPULLUP_XMIN // open pin, inverted #define ENDSTOPPULLUP_YMIN // open pin, inverted // #define ENDSTOPPULLUP_ZMIN - // #define ENDSTOPPULLUP_ZPROBE + // #define ENDSTOPPULLUP_ZMIN_PROBE #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index cdea92f533..c67f51576f 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -319,7 +319,7 @@ Here are some standard links for getting your machine calibrated: // #define ENDSTOPPULLUP_XMIN // #define ENDSTOPPULLUP_YMIN // #define ENDSTOPPULLUP_ZMIN - // #define ENDSTOPPULLUP_ZPROBE + // #define ENDSTOPPULLUP_ZMIN_PROBE #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index f434df8443..6ffb6015a9 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -327,7 +327,7 @@ Here are some standard links for getting your machine calibrated: // #define ENDSTOPPULLUP_XMIN // #define ENDSTOPPULLUP_YMIN // #define ENDSTOPPULLUP_ZMIN - // #define ENDSTOPPULLUP_ZPROBE + // #define ENDSTOPPULLUP_ZMIN_PROBE #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 3ac7366806..add6601ae0 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -362,7 +362,7 @@ Here are some standard links for getting your machine calibrated: // #define ENDSTOPPULLUP_XMIN // #define ENDSTOPPULLUP_YMIN // #define ENDSTOPPULLUP_ZMIN - // #define ENDSTOPPULLUP_ZPROBE + // #define ENDSTOPPULLUP_ZMIN_PROBE #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index d2e9e3d10a..2ade01cffc 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -362,7 +362,7 @@ Here are some standard links for getting your machine calibrated: // #define ENDSTOPPULLUP_XMIN // #define ENDSTOPPULLUP_YMIN // #define ENDSTOPPULLUP_ZMIN - // #define ENDSTOPPULLUP_ZPROBE + // #define ENDSTOPPULLUP_ZMIN_PROBE #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index cb345be303..81eba6c206 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -362,7 +362,7 @@ Here are some standard links for getting your machine calibrated: // #define ENDSTOPPULLUP_XMIN // #define ENDSTOPPULLUP_YMIN // #define ENDSTOPPULLUP_ZMIN - // #define ENDSTOPPULLUP_ZPROBE + // #define ENDSTOPPULLUP_ZMIN_PROBE #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index e2fd1aa640..98e7790da5 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -349,7 +349,7 @@ Here are some standard links for getting your machine calibrated: // #define ENDSTOPPULLUP_XMIN // #define ENDSTOPPULLUP_YMIN // #define ENDSTOPPULLUP_ZMIN - // #define ENDSTOPPULLUP_ZPROBE + // #define ENDSTOPPULLUP_ZMIN_PROBE #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index f9a45de7d2..de777a502b 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -330,7 +330,7 @@ Here are some standard links for getting your machine calibrated: // #define ENDSTOPPULLUP_XMIN // #define ENDSTOPPULLUP_YMIN // #define ENDSTOPPULLUP_ZMIN - // #define ENDSTOPPULLUP_ZPROBE + // #define ENDSTOPPULLUP_ZMIN_PROBE #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 08d64e7f04..ab116736ae 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -317,7 +317,7 @@ Here are some standard links for getting your machine calibrated: // #define ENDSTOPPULLUP_XMIN // #define ENDSTOPPULLUP_YMIN // #define ENDSTOPPULLUP_ZMIN - // #define ENDSTOPPULLUP_ZPROBE + // #define ENDSTOPPULLUP_ZMIN_PROBE #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). diff --git a/Marlin/pins_AZTEEG_X3_PRO.h b/Marlin/pins_AZTEEG_X3_PRO.h index 4da9fb39e4..d3627c3706 100644 --- a/Marlin/pins_AZTEEG_X3_PRO.h +++ b/Marlin/pins_AZTEEG_X3_PRO.h @@ -37,6 +37,7 @@ #if ENABLED(Z_MIN_PROBE_ENDSTOP) //#undef Z_MIN_PIN //#define Z_MIN_PIN 15 + // Define a pin to use as the signal pin on Arduino for the Z probe endstop. #define Z_MIN_PROBE_PIN 19 #endif // diff --git a/Marlin/pins_RUMBA.h b/Marlin/pins_RUMBA.h index f21f219173..bc314c9c71 100644 --- a/Marlin/pins_RUMBA.h +++ b/Marlin/pins_RUMBA.h @@ -27,6 +27,12 @@ #define Z_ENABLE_PIN 62 #define Z_MIN_PIN 33 #define Z_MAX_PIN 32 +#define Z_MIN_PROBE_PIN -1 + +#if ENABLED(Z_MIN_PROBE_ENDSTOP) + // Define a pin to use as the signal pin on Arduino for the Z probe endstop. + #define Z_MIN_PROBE_PIN 33 +#endif #define E0_STEP_PIN 23 #define E0_DIR_PIN 22 diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index f5016a169d..42b903e415 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -74,14 +74,14 @@ static unsigned short step_loops_nominal; volatile long endstops_trigsteps[3] = { 0 }; volatile long endstops_stepsTotal, endstops_stepsDone; -static volatile char endstop_hit_bits = 0; // use X_MIN, Y_MIN, Z_MIN and Z_PROBE as BIT value +static volatile char endstop_hit_bits = 0; // use X_MIN, Y_MIN, Z_MIN and Z_MIN_PROBE as BIT value #if DISABLED(Z_DUAL_ENDSTOPS) static byte #else static uint16_t #endif - old_endstop_bits = 0; // use X_MIN, X_MAX... Z_MAX, Z_PROBE, Z2_MIN, Z2_MAX + old_endstop_bits = 0; // use X_MIN, X_MAX... Z_MAX, Z_MIN_PROBE, Z2_MIN, Z2_MAX #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) bool abort_on_endstop_hit = false; @@ -264,8 +264,8 @@ void checkHitEndstops() { LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "Z"); } #if ENABLED(Z_MIN_PROBE_ENDSTOP) - if (endstop_hit_bits & BIT(Z_PROBE)) { - SERIAL_ECHOPAIR(" Z_PROBE:", (float)endstops_trigsteps[Z_AXIS] / axis_steps_per_unit[Z_AXIS]); + if (endstop_hit_bits & BIT(Z_MIN_PROBE)) { + SERIAL_ECHOPAIR(" Z_MIN_PROBE:", (float)endstops_trigsteps[Z_AXIS] / axis_steps_per_unit[Z_AXIS]); LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "ZP"); } #endif @@ -412,12 +412,12 @@ inline void update_endstops() { #endif // Z_MIN_PIN #if ENABLED(Z_MIN_PROBE_ENDSTOP) - UPDATE_ENDSTOP(Z, PROBE); + UPDATE_ENDSTOP(Z, MIN_PROBE); - if (TEST_ENDSTOP(Z_PROBE)) + if (TEST_ENDSTOP(Z_MIN_PROBE)) { endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS]; - endstop_hit_bits |= BIT(Z_PROBE); + endstop_hit_bits |= BIT(Z_MIN_PROBE); } #endif } @@ -973,7 +973,7 @@ void st_init() { #if HAS_Z_PROBE && ENABLED(Z_MIN_PROBE_ENDSTOP) // Check for Z_MIN_PROBE_ENDSTOP so we don't pull a pin high unless it's to be used. SET_INPUT(Z_MIN_PROBE_PIN); - #if ENABLED(ENDSTOPPULLUP_ZPROBE) + #if ENABLED(ENDSTOPPULLUP_ZMIN_PROBE) WRITE(Z_MIN_PROBE_PIN,HIGH); #endif #endif