preliminary support for soft-limits
This commit is contained in:
parent
5df49c2d3e
commit
5118f788d2
|
|
@ -82,6 +82,33 @@ void process_gcode_command() {
|
|||
// startpoint.E = 0;
|
||||
// moved to dda.c, end of dda_create() and dda_queue.c, next_move()
|
||||
|
||||
// implement axis limits
|
||||
#ifdef X_MIN
|
||||
if (next_target.X < (X_MIN * STEPS_PER_MM_X))
|
||||
next_target.X = X_MIN;
|
||||
#endif
|
||||
#ifdef X_MAX
|
||||
if (next_target.X > (X_MAX * STEPS_PER_MM_X))
|
||||
next_target.X = X_MAX;
|
||||
#endif
|
||||
#ifdef Y_MIN
|
||||
if (next_target.Y < (Y_MIN * STEPS_PER_MM_Y))
|
||||
next_target.Y = Y_MIN;
|
||||
#endif
|
||||
#ifdef Y_MAY
|
||||
if (next_target.Y > (Y_MAX * STEPS_PER_MM_Y))
|
||||
next_target.Y = Y_MAX;
|
||||
#endif
|
||||
#ifdef Z_MIN
|
||||
if (next_target.Z < (Z_MIN * STEPS_PER_MM_Z))
|
||||
next_target.Z = Z_MIN;
|
||||
#endif
|
||||
#ifdef Z_MAX
|
||||
if (next_target.Z > (Z_MAX * STEPS_PER_MM_Z))
|
||||
next_target.Z = Z_MAX;
|
||||
#endif
|
||||
|
||||
|
||||
if (next_target.seen_T) {
|
||||
next_tool = next_target.T;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue