Browse Source

Fixed Z_PROBE_PIN pullup bug.

Documented some additional areas that should be addressed if Z_PROBE is
fully separated from Z_MIN or Z_MAX.
Fixed a documentation error in sanity checks. Servos start at 0 not 1.
pull/1/head
Chris Roadfeldt 9 years ago
parent
commit
17707e7479
  1. 2
      Marlin/Conditionals.h
  2. 945
      Marlin/Marlin_main.cpp
  3. 2
      Marlin/SanityCheck.h
  4. 13
      Marlin/stepper.cpp

2
Marlin/Conditionals.h

@ -186,7 +186,7 @@
#define ENDSTOPPULLUP_ZMIN
#endif
#ifndef DISABLE_Z_PROBE_ENDSTOP
#define ENDSTOPPULL_ZPROBE
#define ENDSTOPPULLUP_ZPROBE
#endif
#endif

945
Marlin/Marlin_main.cpp

File diff suppressed because it is too large

2
Marlin/SanityCheck.h

@ -116,7 +116,7 @@
#error You must have at least 1 servo defined for NUM_SERVOS to use Z_PROBE_AND_ENDSTOP
#endif
#ifndef SERVO_ENDSTOPS
#error You must have SERVO_ENDSTOPS defined and have the Z index set to at least 1 to use Z_PROBE_AND_ENDSTOP
#error You must have SERVO_ENDSTOPS defined and have the Z index set to at least 0 or above to use Z_PROBE_AND_ENDSTOP
#endif
#ifndef SERVO_ENDSTOP_ANGLES
#error You must have SERVO_ENDSTOP_ANGLES defined for Z Extend and Retract to use Z_PROBE_AND_ENSTOP

13
Marlin/stepper.cpp

@ -76,6 +76,7 @@ volatile long endstops_stepsTotal, endstops_stepsDone;
static volatile bool endstop_x_hit = false;
static volatile bool endstop_y_hit = false;
static volatile bool endstop_z_hit = false;
static volatile bool endstop_z_probe_hit = false;
#ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
bool abort_on_endstop_hit = false;
@ -258,11 +259,11 @@ volatile signed char count_direction[NUM_AXIS] = { 1, 1, 1, 1 };
#define DISABLE_STEPPER_DRIVER_INTERRUPT() TIMSK1 &= ~BIT(OCIE1A)
void endstops_hit_on_purpose() {
endstop_x_hit = endstop_y_hit = endstop_z_hit = false;
endstop_x_hit = endstop_y_hit = endstop_z_hit = endstop_z_probe_hit = false;
}
void checkHitEndstops() {
if (endstop_x_hit || endstop_y_hit || endstop_z_hit) {
if (endstop_x_hit || endstop_y_hit || endstop_z_hit || endstop_z_probe_hit) {
SERIAL_ECHO_START;
SERIAL_ECHOPGM(MSG_ENDSTOPS_HIT);
if (endstop_x_hit) {
@ -277,6 +278,10 @@ void checkHitEndstops() {
SERIAL_ECHOPAIR(" Z:", (float)endstops_trigsteps[Z_AXIS] / axis_steps_per_unit[Z_AXIS]);
LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "Z");
}
if (endstop_z_probe_hit) {
SERIAL_ECHOPAIR(" Z_PROBE:", (float)endstops_trigsteps[Z_AXIS] / axis_steps_per_unit[Z_AXIS]);
LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "ZP");
}
SERIAL_EOL;
endstops_hit_on_purpose();
@ -549,7 +554,7 @@ ISR(TIMER1_COMPA_vect) {
if(z_probe_endstop && old_z_probe_endstop)
{
endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
endstop_z_hit=true;
endstop_z_probe_hit=true;
// if (z_probe_endstop && old_z_probe_endstop) SERIAL_ECHOLN("z_probe_endstop = true");
}
@ -596,7 +601,7 @@ ISR(TIMER1_COMPA_vect) {
if(z_probe_endstop && old_z_probe_endstop)
{
endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
endstop_z_hit=true;
endstop_z_probe_hit=true;
// if (z_probe_endstop && old_z_probe_endstop) SERIAL_ECHOLN("z_probe_endstop = true");
}
old_z_probe_endstop = z_probe_endstop;

Loading…
Cancel
Save