From 658eb6a8b3cff0da59a61cbb5aa04d2c693c36c3 Mon Sep 17 00:00:00 2001 From: chamnit Date: Tue, 26 Jul 2016 13:16:43 -0600 Subject: [PATCH] Non-CoreXY compiling fix. --- doc/log/commit_log_v0.9j.txt | 11 +++++++++++ grbl/system.c | 18 ++++++++++-------- grbl/system.h | 6 ++++-- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/doc/log/commit_log_v0.9j.txt b/doc/log/commit_log_v0.9j.txt index 3dd0526..e6569c3 100644 --- a/doc/log/commit_log_v0.9j.txt +++ b/doc/log/commit_log_v0.9j.txt @@ -1,3 +1,14 @@ +---------------- +Date: 2016-07-26 +Author: chamnit +Subject: Fixed homing on CoreXY machines only. + +- The homing routine for CoreXY/H-Bot CNC machines has been fixed. + +- Version date bumped, but this update does NOT effect any normal +users. Only CoreXY users. + + ---------------- Date: 2016-07-26 Author: chamnit diff --git a/grbl/system.c b/grbl/system.c index 854221e..48aac64 100644 --- a/grbl/system.c +++ b/grbl/system.c @@ -289,12 +289,14 @@ void system_convert_array_steps_to_mpos(float *position, int32_t *steps) // CoreXY calculation only. Returns x or y-axis "steps" based on CoreXY motor steps. -int32_t system_convert_corexy_to_x_axis_steps(int32_t *steps) -{ - return( (steps[A_MOTOR] + steps[B_MOTOR])/2 ); -} -int32_t system_convert_corexy_to_y_axis_steps(int32_t *steps) -{ - return( (steps[A_MOTOR] - steps[B_MOTOR])/2 ); -} +#ifdef COREXY + int32_t system_convert_corexy_to_x_axis_steps(int32_t *steps) + { + return( (steps[A_MOTOR] + steps[B_MOTOR])/2 ); + } + int32_t system_convert_corexy_to_y_axis_steps(int32_t *steps) + { + return( (steps[A_MOTOR] - steps[B_MOTOR])/2 ); + } +#endif diff --git a/grbl/system.h b/grbl/system.h index 09a3171..d523eb5 100644 --- a/grbl/system.h +++ b/grbl/system.h @@ -107,7 +107,9 @@ float system_convert_axis_steps_to_mpos(int32_t *steps, uint8_t idx); void system_convert_array_steps_to_mpos(float *position, int32_t *steps); // CoreXY calculation only. Returns x or y-axis "steps" based on CoreXY motor steps. -int32_t system_convert_corexy_to_x_axis_steps(int32_t *steps); -int32_t system_convert_corexy_to_y_axis_steps(int32_t *steps); +#ifdef COREXY + int32_t system_convert_corexy_to_x_axis_steps(int32_t *steps); + int32_t system_convert_corexy_to_y_axis_steps(int32_t *steps); +#endif #endif