From 5efb12e889b6e7424839ba7dbb7bbbb72baaff5e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 15 Sep 2016 03:18:10 -0500 Subject: [PATCH] Simpler report_current_position for SCARA --- Marlin/Marlin_main.cpp | 16 ++-------------- Marlin/stepper.h | 10 +++++----- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 3a00846d9..fd3d371a2 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -5116,20 +5116,8 @@ static void report_current_position() { stepper.report_positions(); #if IS_SCARA - SERIAL_PROTOCOLPGM("SCARA Theta:"); - SERIAL_PROTOCOL(delta[A_AXIS]); - SERIAL_PROTOCOLPGM(" Psi+Theta:"); - SERIAL_PROTOCOLLN(delta[B_AXIS]); - - SERIAL_PROTOCOLPGM("SCARA Cal - Theta:"); - SERIAL_PROTOCOL(delta[A_AXIS]); - SERIAL_PROTOCOLPGM(" Psi+Theta (90):"); - SERIAL_PROTOCOLLN(delta[B_AXIS] - delta[A_AXIS] - 90); - - SERIAL_PROTOCOLPGM("SCARA step Cal - Theta:"); - SERIAL_PROTOCOL(delta[A_AXIS] / 90 * planner.axis_steps_per_mm[A_AXIS]); - SERIAL_PROTOCOLPGM(" Psi+Theta:"); - SERIAL_PROTOCOLLN((delta[B_AXIS] - delta[A_AXIS]) / 90 * planner.axis_steps_per_mm[A_AXIS]); + SERIAL_PROTOCOLPAIR("SCARA Theta:", stepper.get_axis_position_mm(A_AXIS)); + SERIAL_PROTOCOLLNPAIR(" Psi+Theta:", stepper.get_axis_position_mm(B_AXIS)); SERIAL_EOL; #endif } diff --git a/Marlin/stepper.h b/Marlin/stepper.h index 282690348..2eaeaf490 100644 --- a/Marlin/stepper.h +++ b/Marlin/stepper.h @@ -91,11 +91,6 @@ class Stepper { static bool performing_homing; #endif - // - // Positions of stepper motors, in step units - // - static volatile long count_position[NUM_AXIS]; - private: static unsigned char last_direction_bits; // The next stepping-bits to be output @@ -143,6 +138,11 @@ class Stepper { static const int motor_current_setting[3] = PWM_MOTOR_CURRENT; #endif + // + // Positions of stepper motors, in step units + // + static volatile long count_position[NUM_AXIS]; + // // Current direction of stepper motors (+1 or -1) //