From 03acd8527215d380a3dec0dd9081d7fc0a1d4cce Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Thu, 3 Mar 2011 23:47:34 -0800 Subject: [PATCH] gcode_process.c: When reaching MIN/MAX properly scale clamp value to steps. --- gcode_process.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gcode_process.c b/gcode_process.c index b963569..81f539a 100644 --- a/gcode_process.c +++ b/gcode_process.c @@ -89,27 +89,27 @@ void process_gcode_command() { // implement axis limits #ifdef X_MIN if (next_target.target.X < (X_MIN * STEPS_PER_MM_X)) - next_target.target.X = X_MIN; + next_target.target.X = X_MIN * STEPS_PER_MM_X; #endif #ifdef X_MAX if (next_target.target.X > (X_MAX * STEPS_PER_MM_X)) - next_target.target.X = X_MAX; + next_target.target.X = X_MAX * STEPS_PER_MM_X; #endif #ifdef Y_MIN if (next_target.target.Y < (Y_MIN * STEPS_PER_MM_Y)) - next_target.target.Y = Y_MIN; + next_target.target.Y = Y_MIN * STEPS_PER_MM_Y; #endif #ifdef Y_MAX if (next_target.target.Y > (Y_MAX * STEPS_PER_MM_Y)) - next_target.target.Y = Y_MAX; + next_target.target.Y = Y_MAX * STEPS_PER_MM_Y; #endif #ifdef Z_MIN if (next_target.target.Z < (Z_MIN * STEPS_PER_MM_Z)) - next_target.target.Z = Z_MIN; + next_target.target.Z = Z_MIN * STEPS_PER_MM_Z; #endif #ifdef Z_MAX if (next_target.target.Z > (Z_MAX * STEPS_PER_MM_Z)) - next_target.target.Z = Z_MAX; + next_target.target.Z = Z_MAX * STEPS_PER_MM_Z; #endif