Browse Source

Merge pull request #6327 from Bob-the-Kuhn/M43-toggle-&-Z-probe-fixes

M43 Toggle & Z servo test - fix bug & add another check
pull/1/head
Scott Lahteine 8 years ago
committed by GitHub
parent
commit
de569e3d4e
  1. 2
      .travis.yml
  2. 16
      Marlin/Marlin_main.cpp

2
.travis.yml

@ -334,7 +334,7 @@ script:
# RA_CONTROL_PANEL # RA_CONTROL_PANEL
# #
- restore_configs - restore_configs
- opt_enable RA_CONTROL_PANEL - opt_enable RA_CONTROL_PANEL PINS_DEBUGGING
- build_marlin - build_marlin
# #
######## I2C LCD/PANELS ############## ######## I2C LCD/PANELS ##############

16
Marlin/Marlin_main.cpp

@ -5841,12 +5841,11 @@ inline void gcode_M42() {
#if !(NUM_SERVOS >= 1 && HAS_SERVO_0) #if !(NUM_SERVOS >= 1 && HAS_SERVO_0)
SERIAL_ERROR_START; SERIAL_ERROR_START;
SERIAL_ERRORLNPGM("SERVO not setup"); SERIAL_ERRORLNPGM("SERVO not setup");
#elif !HAS_Z_SERVO_ENDSTOP
SERIAL_ERROR_START;
SERIAL_ERRORLNPGM("Z_ENDSTOP_SERVO_NR not setup");
#else #else
uint8_t probe_index = code_seen('P') ? code_value_byte() : Z_ENDSTOP_SERVO_NR;
#if !defined(z_servo_angle)
const int z_servo_angle[2] = Z_SERVO_ANGLES;
#endif
uint8_t probe_index = code_seen('P') ? code_value_byte() : 0;
SERIAL_PROTOCOLLNPGM("Servo probe test"); SERIAL_PROTOCOLLNPGM("Servo probe test");
SERIAL_PROTOCOLLNPAIR(". using index: ", probe_index); SERIAL_PROTOCOLLNPAIR(". using index: ", probe_index);
SERIAL_PROTOCOLLNPAIR(". deploy angle: ", z_servo_angle[0]); SERIAL_PROTOCOLLNPAIR(". deploy angle: ", z_servo_angle[0]);
@ -5862,7 +5861,6 @@ inline void gcode_M42() {
probe_inverting = Z_MIN_ENDSTOP_INVERTING; probe_inverting = Z_MIN_ENDSTOP_INVERTING;
#elif ENABLED(Z_MIN_PROBE_ENDSTOP) #elif ENABLED(Z_MIN_PROBE_ENDSTOP)
#define PROBE_TEST_PIN Z_MIN_PROBE_PIN #define PROBE_TEST_PIN Z_MIN_PROBE_PIN
SERIAL_PROTOCOLLNPAIR(". probe uses Z_MIN_PROBE_PIN: ", PROBE_TEST_PIN); SERIAL_PROTOCOLLNPAIR(". probe uses Z_MIN_PROBE_PIN: ", PROBE_TEST_PIN);
SERIAL_PROTOCOLLNPGM(". uses Z_MIN_PROBE_ENDSTOP_INVERTING (ignores Z_MIN_ENDSTOP_INVERTING)"); SERIAL_PROTOCOLLNPGM(". uses Z_MIN_PROBE_ENDSTOP_INVERTING (ignores Z_MIN_ENDSTOP_INVERTING)");
SERIAL_PROTOCOLPGM(". Z_MIN_PROBE_ENDSTOP_INVERTING: "); SERIAL_PROTOCOLPGM(". Z_MIN_PROBE_ENDSTOP_INVERTING: ");
@ -5887,7 +5885,7 @@ inline void gcode_M42() {
if (probe_inverting != deploy_state) SERIAL_PROTOCOLLNPGM("WARNING - INVERTING setting probably backwards"); if (probe_inverting != deploy_state) SERIAL_PROTOCOLLNPGM("WARNING - INVERTING setting probably backwards");
refresh_cmd_timeout(); refresh_cmd_timeout();
if (deploy_state != stow_state) { if (deploy_state != stow_state) {
SERIAL_PROTOCOLLNPGM("TLTouch detected"); // BLTouch clone? SERIAL_PROTOCOLLNPGM("BLTouch clone detected");
if (deploy_state) { if (deploy_state) {
SERIAL_PROTOCOLLNPGM(". DEPLOYED state: HIGH (logic 1)"); SERIAL_PROTOCOLLNPGM(". DEPLOYED state: HIGH (logic 1)");
SERIAL_PROTOCOLLNPGM(". STOWED (triggered) state: LOW (logic 0)"); SERIAL_PROTOCOLLNPGM(". STOWED (triggered) state: LOW (logic 0)");
@ -5896,6 +5894,10 @@ inline void gcode_M42() {
SERIAL_PROTOCOLLNPGM(". DEPLOYED state: LOW (logic 0)"); SERIAL_PROTOCOLLNPGM(". DEPLOYED state: LOW (logic 0)");
SERIAL_PROTOCOLLNPGM(". STOWED (triggered) state: HIGH (logic 1)"); SERIAL_PROTOCOLLNPGM(". STOWED (triggered) state: HIGH (logic 1)");
} }
#if ENABLED(BLTOUCH)
SERIAL_PROTOCOLLNPGM("ERROR: BLTOUCH enabled - set this device up as a Z Servo Probe with inverting as true.");
#endif
} }
else { // measure active signal length else { // measure active signal length
servo[probe_index].move(z_servo_angle[0]); //deploy servo[probe_index].move(z_servo_angle[0]); //deploy

Loading…
Cancel
Save