From 96ae53cf41fc0f6f6003fc1a5e2a2ddac4f3ac4f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 14 Aug 2017 23:52:23 -0500 Subject: [PATCH] Use MOVE_SERVO macro where possible --- Marlin/Marlin_main.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index f9db4f49ba..04e5716b2a 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2102,7 +2102,7 @@ static void clean_up_after_endstop_or_probe_move() { #if ENABLED(BLTOUCH) void bltouch_command(int angle) { - servo[Z_ENDSTOP_SERVO_NR].move(angle); // Give the BL-Touch the command and wait + MOVE_SERVO(Z_ENDSTOP_SERVO_NR, angle); // Give the BL-Touch the command and wait safe_delay(BLTOUCH_DELAY); } @@ -2206,7 +2206,7 @@ static void clean_up_after_endstop_or_probe_move() { #elif HAS_Z_SERVO_ENDSTOP && DISABLED(BLTOUCH) - servo[Z_ENDSTOP_SERVO_NR].move(z_servo_angle[deploy ? 0 : 1]); + MOVE_SERVO(Z_ENDSTOP_SERVO_NR, z_servo_angle[deploy ? 0 : 1]); #elif ENABLED(Z_PROBE_ALLEN_KEY) @@ -6663,7 +6663,7 @@ inline void gcode_M42() { SERIAL_ERROR_START(); SERIAL_ERRORLNPGM("Z_ENDSTOP_SERVO_NR not setup"); - #else + #else // HAS_Z_SERVO_ENDSTOP const uint8_t probe_index = parser.byteval('P', Z_ENDSTOP_SERVO_NR); @@ -6711,10 +6711,10 @@ inline void gcode_M42() { SET_INPUT_PULLUP(PROBE_TEST_PIN); bool deploy_state, stow_state; for (uint8_t i = 0; i < 4; i++) { - servo[probe_index].move(z_servo_angle[0]); //deploy + MOVE_SERVO(probe_index, z_servo_angle[0]); //deploy safe_delay(500); deploy_state = READ(PROBE_TEST_PIN); - servo[probe_index].move(z_servo_angle[1]); //stow + MOVE_SERVO(probe_index, z_servo_angle[1]); //stow safe_delay(500); stow_state = READ(PROBE_TEST_PIN); } @@ -6738,7 +6738,7 @@ inline void gcode_M42() { } else { // measure active signal length - servo[probe_index].move(z_servo_angle[0]); // deploy + MOVE_SERVO(probe_index, z_servo_angle[0]); // deploy safe_delay(500); SERIAL_PROTOCOLLNPGM("please trigger probe"); uint16_t probe_counter = 0; @@ -6763,7 +6763,7 @@ inline void gcode_M42() { else SERIAL_PROTOCOLLNPGM("noise detected - please re-run test"); // less than 2mS pulse - servo[probe_index].move(z_servo_angle[1]); //stow + MOVE_SERVO(probe_index, z_servo_angle[1]); //stow } // pulse detected