gcode_process.c: When reaching MIN/MAX properly scale clamp value to steps.

This commit is contained in:
Ben Jackson 2011-03-03 23:47:34 -08:00 committed by Michael Moon
parent 5bb337c1a5
commit 03acd85272
1 changed files with 6 additions and 6 deletions

View File

@ -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