Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
The reverses all the changes from PR MarlinFirmware#3082 pending further
investigation.
  • Loading branch information
thinkyhead committed Mar 24, 2016
1 parent da9d4c4 commit 762d08b
Show file tree
Hide file tree
Showing 23 changed files with 37 additions and 416 deletions.
5 changes: 0 additions & 5 deletions Marlin/Conditionals.h
Original file line number Diff line number Diff line change
Expand Up @@ -612,10 +612,5 @@
#endif
#endif

#if ( (HAS_Z_MIN && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)) || HAS_Z_PROBE ) && \
( ENABLED(FIX_MOUNTED_PROBE) || defined(Z_ENDSTOP_SERVO_NR) || ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) )
#define HAS_Z_MIN_PROBE
#endif

#endif //CONFIGURATION_LCD
#endif //CONDITIONALS_H
18 changes: 1 addition & 17 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -373,18 +373,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define Z_MIN_PROBE_ENDSTOP

// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE.
// The Z_MIN_PIN will then be used for both Z-homing and probing.
#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN

// To use a probe you must enable one of the two options above!

// This option disables the use of the Z_MIN_PROBE_PIN
// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a
// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above.
// If you're using the Z MIN endstop connector for your Z probe, this has no effect.
//#define DISABLE_Z_MIN_PROBE_ENDSTOP

// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
// :{0:'Low',1:'High'}
#define X_ENABLE_ON 0
Expand Down Expand Up @@ -565,11 +553,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l

// Probes are sensors/switches that need to be activated before they can be used
// and deactivated after the use.
// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE

// A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER
// when the hardware endstops are active.
//#define FIX_MOUNTED_PROBE
// Allen Key Probes, Servo Probes, Z-Sled Probes.... You have to activate one of these for the AUTO_BED_LEVELING_FEATURE.

// A Servo Probe can be defined in the servo section below.

Expand Down
50 changes: 9 additions & 41 deletions Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -473,10 +473,6 @@ void gcode_M114();
float extrude_min_temp = EXTRUDE_MINTEMP;
#endif

#if ENABLED(HAS_Z_MIN_PROBE)
extern volatile bool z_probe_is_active;
#endif

#if ENABLED(SDSUPPORT)
#include "SdFatUtil.h"
int freeMemory() { return SdFatUtil::FreeRam(); }
Expand Down Expand Up @@ -631,9 +627,7 @@ void servo_init() {
servo[3].detach();
#endif

#if HAS_SERVO_ENDSTOPS

z_probe_is_active = false;
#if HAS_SERVO_ENDSTOPS

/**
* Set position of all defined Servo Endstops
Expand Down Expand Up @@ -1484,8 +1478,6 @@ static void setup_for_endstop_move() {
refresh_cmd_timeout();
}

#if ENABLED(HAS_Z_MIN_PROBE)

static void deploy_z_probe() {

#if ENABLED(DEBUG_LEVELING_FEATURE)
Expand All @@ -1494,8 +1486,6 @@ static void setup_for_endstop_move() {
}
#endif

if (z_probe_is_active) return;

#if HAS_SERVO_ENDSTOPS

// Engage Z Servo endstop if enabled
Expand Down Expand Up @@ -1574,12 +1564,6 @@ static void setup_for_endstop_move() {

#endif // Z_PROBE_ALLEN_KEY

#if ENABLED(FIX_MOUNTED_PROBE)
// Noting to be done. Just set z_probe_is_active
#endif

z_probe_is_active = true;

}

static void stow_z_probe(bool doRaise = true) {
Expand All @@ -1589,8 +1573,6 @@ static void setup_for_endstop_move() {
}
#endif

if (!z_probe_is_active) return;

#if HAS_SERVO_ENDSTOPS

// Retract Z Servo endstop if enabled
Expand Down Expand Up @@ -1676,13 +1658,7 @@ static void setup_for_endstop_move() {
}
#endif // Z_PROBE_ALLEN_KEY

#if ENABLED(FIX_MOUNTED_PROBE)
// Noting to be done. Just set z_probe_is_active
#endif

z_probe_is_active = false;
}
#endif // HAS_Z_MIN_PROBE

enum ProbeAction {
ProbeStay = 0,
Expand Down Expand Up @@ -1875,8 +1851,6 @@ static void unknown_position_error() {
}
#endif

if (z_probe_is_active == dock) return;

if (!axis_known_position[X_AXIS] || !axis_known_position[Y_AXIS]) {
unknown_position_error();
return;
Expand All @@ -1897,8 +1871,6 @@ static void unknown_position_error() {
digitalWrite(SLED_PIN, HIGH); // turn on magnet
}
do_blocking_move_to_x(oldXpos); // return to position before docking

z_probe_is_active = dock;
}

#endif // Z_PROBE_SLED
Expand Down Expand Up @@ -1939,7 +1911,8 @@ static void homeaxis(AxisEnum axis) {
if (axis == Z_AXIS) {
if (axis_home_dir < 0) dock_sled(false);
}
#elif SERVO_LEVELING || ENABLED(FIX_MOUNTED_PROBE)

#elif SERVO_LEVELING && DISABLED(Z_PROBE_SLED)

// Deploy a Z probe if there is one, and homing towards the bed
if (axis == Z_AXIS) {
Expand All @@ -1950,10 +1923,8 @@ static void homeaxis(AxisEnum axis) {

#if HAS_SERVO_ENDSTOPS
// Engage Servo endstop if enabled
if (axis != Z_AXIS && servo_endstop_id[axis] >= 0) {
if (axis != Z_AXIS && servo_endstop_id[axis] >= 0)
servo[servo_endstop_id[axis]].move(servo_endstop_angle[axis][0]);
z_probe_is_active = true;
}
#endif

// Set a flag for Z motor locking
Expand Down Expand Up @@ -2086,7 +2057,7 @@ static void homeaxis(AxisEnum axis) {
if (axis == Z_AXIS) {
if (axis_home_dir < 0) dock_sled(true);
}
#elif SERVO_LEVELING || ENABLED(FIX_MOUNTED_PROBE)
#elif SERVO_LEVELING && DISABLED(Z_PROBE_SLED)

// Deploy a Z probe if there is one, and homing towards the bed
if (axis == Z_AXIS) {
Expand All @@ -2113,7 +2084,6 @@ static void homeaxis(AxisEnum axis) {
}
#endif
servo[servo_endstop_id[axis]].move(servo_endstop_angle[axis][1]);
z_probe_is_active = false;
}
#endif
}
Expand Down Expand Up @@ -3328,9 +3298,6 @@ inline void gcode_G28() {
}
#endif
enqueue_and_echo_commands_P(PSTR(Z_PROBE_END_SCRIPT));
#if ENABLED(HAS_Z_MIN_PROBE)
z_probe_is_active = false;
#endif
st_synchronize();
#endif

Expand All @@ -3355,11 +3322,11 @@ inline void gcode_G28() {
#if HAS_SERVO_ENDSTOPS
raise_z_for_servo();
#endif
deploy_z_probe(); // Engage Z Servo endstop if available. Z_PROBE_SLED is missed her.
deploy_z_probe(); // Engage Z Servo endstop if available. Z_PROBE_SLED is missed here.

st_synchronize();
// TODO: clear the leveling matrix or the planner will be set incorrectly
setup_for_endstop_move(); // to late. Must be done before deploying.
setup_for_endstop_move(); // Too late. Must be done before deploying.

feedrate = homing_feedrate[Z_AXIS];

Expand All @@ -3372,11 +3339,12 @@ inline void gcode_G28() {
SERIAL_PROTOCOL(current_position[Z_AXIS] + 0.0001);
SERIAL_EOL;

clean_up_after_endstop_move(); // to early. must be done after the stowing.
clean_up_after_endstop_move(); // Too early. must be done after the stowing.

#if HAS_SERVO_ENDSTOPS
raise_z_for_servo();
#endif

stow_z_probe(false); // Retract Z Servo endstop if available. Z_PROBE_SLED is missed her.

gcode_M114(); // Send end position to RepetierHost
Expand Down
28 changes: 0 additions & 28 deletions Marlin/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,34 +127,6 @@
#error MESH_BED_LEVELING is required for MANUAL_BED_LEVELING.
#endif

/**
* Probes
*/

/**
* A probe needs a pin
*/
#if (!((HAS_Z_MIN && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)) || HAS_Z_PROBE )) && ( ENABLED(FIX_MOUNTED_PROBE) || defined(Z_ENDSTOP_SERVO_NR) || ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED))
#error A probe needs a pin! [Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN || HAS_Z_PROBE]
#endif

#if ((HAS_Z_MIN && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)) && HAS_Z_PROBE) && ( ENABLED(FIX_MOUNTED_PROBE) || defined(Z_ENDSTOP_SERVO_NR) || ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED))
#error A probe should not be connected to more then one pin! [Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN || HAS_Z_PROBE]
#endif

/**
* Require one kind of probe
*/
#if ENABLED(AUTO_BED_LEVELING_FEATURE) && !( ENABLED(FIX_MOUNTED_PROBE) || defined(Z_ENDSTOP_SERVO_NR) || ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED))
#error For AUTO_BED_LEVELING_FEATURE define one kind of probe! {Servo | Z_PROBE_ALLEN_KEY | Z_PROBE_SLED | FIX_MOUNTED_PROBE]
#endif

#if ENABLED(Z_SAFE_HOMING)&& !( ENABLED(FIX_MOUNTED_PROBE) || defined(Z_ENDSTOP_SERVO_NR) || ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED))
#error For Z_SAFE_HOMING define one kind of probe! {Servo | Z_PROBE_ALLEN_KEY | Z_PROBE_SLED | FIX_MOUNTED_PROBE]
#endif

// To do: Fail with more then one probe defined

/**
* Auto Bed Leveling
*/
Expand Down
18 changes: 1 addition & 17 deletions Marlin/example_configurations/Felix/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -355,18 +355,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define Z_MIN_PROBE_ENDSTOP

// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE.
// The Z_MIN_PIN will then be used for both Z-homing and probing.
#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN

// To use a probe you must enable one of the two options above!

// This option disables the use of the Z_MIN_PROBE_PIN
// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a
// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above.
// If you're using the Z MIN endstop connector for your Z probe, this has no effect.
//#define DISABLE_Z_MIN_PROBE_ENDSTOP

// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
// :{0:'Low',1:'High'}
#define X_ENABLE_ON 0
Expand Down Expand Up @@ -547,11 +535,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l

// Probes are sensors/switches that need to be activated before they can be used
// and deactivated after the use.
// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE

// A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER
// when the hardware endstops are active.
//#define FIX_MOUNTED_PROBE
// Allen Key Probes, Servo Probes, Z-Sled Probes.... You have to activate one of these for the AUTO_BED_LEVELING_FEATURE.

// A Servo Probe can be defined in the servo section below.

Expand Down
18 changes: 1 addition & 17 deletions Marlin/example_configurations/Felix/Configuration_DUAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -352,18 +352,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define Z_MIN_PROBE_ENDSTOP

// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE.
// The Z_MIN_PIN will then be used for both Z-homing and probing.
#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN

// To use a probe you must enable one of the two options above!

// This option disables the use of the Z_MIN_PROBE_PIN
// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a
// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above.
// If you're using the Z MIN endstop connector for your Z probe, this has no effect.
//#define DISABLE_Z_MIN_PROBE_ENDSTOP

// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
// :{0:'Low',1:'High'}
#define X_ENABLE_ON 0
Expand Down Expand Up @@ -544,11 +532,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l

// Probes are sensors/switches that need to be activated before they can be used
// and deactivated after the use.
// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE

// A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER
// when the hardware endstops are active.
//#define FIX_MOUNTED_PROBE
// Allen Key Probes, Servo Probes, Z-Sled Probes.... You have to activate one of these for the AUTO_BED_LEVELING_FEATURE.

// A Servo Probe can be defined in the servo section below.

Expand Down
18 changes: 1 addition & 17 deletions Marlin/example_configurations/Hephestos/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -365,18 +365,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
//#define Z_MIN_PROBE_ENDSTOP

// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE.
// The Z_MIN_PIN will then be used for both Z-homing and probing.
#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN

// To use a probe you must enable one of the two options above!

// This option disables the use of the Z_MIN_PROBE_PIN
// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a
// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above.
// If you're using the Z MIN endstop connector for your Z probe, this has no effect.
//#define DISABLE_Z_MIN_PROBE_ENDSTOP

// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
// :{0:'Low',1:'High'}
#define X_ENABLE_ON 0
Expand Down Expand Up @@ -557,11 +545,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo

// Probes are sensors/switches that need to be activated before they can be used
// and deactivated after the use.
// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE

// A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER
// when the hardware endstops are active.
//#define FIX_MOUNTED_PROBE
// Allen Key Probes, Servo Probes, Z-Sled Probes.... You have to activate one of these for the AUTO_BED_LEVELING_FEATURE.

// A Servo Probe can be defined in the servo section below.

Expand Down
18 changes: 1 addition & 17 deletions Marlin/example_configurations/Hephestos_2/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -367,18 +367,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define Z_MIN_PROBE_ENDSTOP

// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE.
// The Z_MIN_PIN will then be used for both Z-homing and probing.
#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN

// To use a probe you must enable one of the two options above!

// This option disables the use of the Z_MIN_PROBE_PIN
// To enable the Z probe pin but disable its use, uncomment the line below. This only affects a
// Z probe switch if you have a separate Z min endstop also and have activated Z_MIN_PROBE_ENDSTOP above.
// If you're using the Z MIN endstop connector for your Z probe, this has no effect.
//#define DISABLE_Z_MIN_PROBE_ENDSTOP

// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
// :{0:'Low',1:'High'}
#define X_ENABLE_ON 0
Expand Down Expand Up @@ -559,11 +547,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l

// Probes are sensors/switches that need to be activated before they can be used
// and deactivated after the use.
// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, ... . You have to activate one of these for the AUTO_BED_LEVELING_FEATURE

// A fix mounted probe, like the normal inductive probe, must be deactivated to go below Z_PROBE_OFFSET_FROM_EXTRUDER
// when the hardware endstops are active.
#define FIX_MOUNTED_PROBE
// Allen Key Probes, Servo Probes, Z-Sled Probes.... You have to activate one of these for the AUTO_BED_LEVELING_FEATURE.

// A Servo Probe can be defined in the servo section below.

Expand Down
Loading

0 comments on commit 762d08b

Please sign in to comment.