Browse Source

Only clamp panel movements if software endstops are enabled

pull/1/head
Guillaume Seguin 12 years ago
parent
commit
aa65c20d1f
  1. 12
      Marlin/ultralcd.cpp

12
Marlin/ultralcd.cpp

@ -357,9 +357,9 @@ static void lcd_move_x()
if (encoderPosition != 0)
{
current_position[X_AXIS] += float((int)encoderPosition) * move_menu_scale;
if (current_position[X_AXIS] < X_MIN_POS)
if (min_software_endstops && current_position[X_AXIS] < X_MIN_POS)
current_position[X_AXIS] = X_MIN_POS;
if (current_position[X_AXIS] > X_MAX_POS)
if (max_software_endstops && current_position[X_AXIS] > X_MAX_POS)
current_position[X_AXIS] = X_MAX_POS;
encoderPosition = 0;
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 600, active_extruder);
@ -381,9 +381,9 @@ static void lcd_move_y()
if (encoderPosition != 0)
{
current_position[Y_AXIS] += float((int)encoderPosition) * move_menu_scale;
if (current_position[Y_AXIS] < Y_MIN_POS)
if (min_software_endstops && current_position[Y_AXIS] < Y_MIN_POS)
current_position[Y_AXIS] = Y_MIN_POS;
if (current_position[Y_AXIS] > Y_MAX_POS)
if (max_software_endstops && current_position[Y_AXIS] > Y_MAX_POS)
current_position[Y_AXIS] = Y_MAX_POS;
encoderPosition = 0;
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 600, active_extruder);
@ -405,9 +405,9 @@ static void lcd_move_z()
if (encoderPosition != 0)
{
current_position[Z_AXIS] += float((int)encoderPosition) * move_menu_scale;
if (current_position[Z_AXIS] < Z_MIN_POS)
if (min_software_endstops && current_position[Z_AXIS] < Z_MIN_POS)
current_position[Z_AXIS] = Z_MIN_POS;
if (current_position[Z_AXIS] > Z_MAX_POS)
if (max_software_endstops && current_position[Z_AXIS] > Z_MAX_POS)
current_position[Z_AXIS] = Z_MAX_POS;
encoderPosition = 0;
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 60, active_extruder);

Loading…
Cancel
Save