Browse Source

Only clamp panel movements if software endstops are enabled

Guillaume Seguin 12 years ago
parent
commit
aa65c20d1f
1 changed files with 6 additions and 6 deletions
  1. 6
    6
      Marlin/ultralcd.cpp

+ 6
- 6
Marlin/ultralcd.cpp View File

@@ -357,9 +357,9 @@ static void lcd_move_x()
357 357
     if (encoderPosition != 0)
358 358
     {
359 359
         current_position[X_AXIS] += float((int)encoderPosition) * move_menu_scale;
360
-        if (current_position[X_AXIS] < X_MIN_POS)
360
+        if (min_software_endstops && current_position[X_AXIS] < X_MIN_POS)
361 361
             current_position[X_AXIS] = X_MIN_POS;
362
-        if (current_position[X_AXIS] > X_MAX_POS)
362
+        if (max_software_endstops && current_position[X_AXIS] > X_MAX_POS)
363 363
             current_position[X_AXIS] = X_MAX_POS;
364 364
         encoderPosition = 0;
365 365
         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()
381 381
     if (encoderPosition != 0)
382 382
     {
383 383
         current_position[Y_AXIS] += float((int)encoderPosition) * move_menu_scale;
384
-        if (current_position[Y_AXIS] < Y_MIN_POS)
384
+        if (min_software_endstops && current_position[Y_AXIS] < Y_MIN_POS)
385 385
             current_position[Y_AXIS] = Y_MIN_POS;
386
-        if (current_position[Y_AXIS] > Y_MAX_POS)
386
+        if (max_software_endstops && current_position[Y_AXIS] > Y_MAX_POS)
387 387
             current_position[Y_AXIS] = Y_MAX_POS;
388 388
         encoderPosition = 0;
389 389
         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()
405 405
     if (encoderPosition != 0)
406 406
     {
407 407
         current_position[Z_AXIS] += float((int)encoderPosition) * move_menu_scale;
408
-        if (current_position[Z_AXIS] < Z_MIN_POS)
408
+        if (min_software_endstops && current_position[Z_AXIS] < Z_MIN_POS)
409 409
             current_position[Z_AXIS] = Z_MIN_POS;
410
-        if (current_position[Z_AXIS] > Z_MAX_POS)
410
+        if (max_software_endstops && current_position[Z_AXIS] > Z_MAX_POS)
411 411
             current_position[Z_AXIS] = Z_MAX_POS;
412 412
         encoderPosition = 0;
413 413
         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