Browse Source

Merge pull request #531 from iXce/Marlin_v1_lcd

Only clamp panel movements if software endstops are enabled
ErikZalm 11 years ago
parent
commit
8a2a3ef91d
1 changed files with 6 additions and 6 deletions
  1. 6
    6
      Marlin/ultralcd.cpp

+ 6
- 6
Marlin/ultralcd.cpp View File

360
     if (encoderPosition != 0)
360
     if (encoderPosition != 0)
361
     {
361
     {
362
         current_position[X_AXIS] += float((int)encoderPosition) * move_menu_scale;
362
         current_position[X_AXIS] += float((int)encoderPosition) * move_menu_scale;
363
-        if (current_position[X_AXIS] < X_MIN_POS)
363
+        if (min_software_endstops && current_position[X_AXIS] < X_MIN_POS)
364
             current_position[X_AXIS] = X_MIN_POS;
364
             current_position[X_AXIS] = X_MIN_POS;
365
-        if (current_position[X_AXIS] > X_MAX_POS)
365
+        if (max_software_endstops && current_position[X_AXIS] > X_MAX_POS)
366
             current_position[X_AXIS] = X_MAX_POS;
366
             current_position[X_AXIS] = X_MAX_POS;
367
         encoderPosition = 0;
367
         encoderPosition = 0;
368
         plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 600, active_extruder);
368
         plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 600, active_extruder);
384
     if (encoderPosition != 0)
384
     if (encoderPosition != 0)
385
     {
385
     {
386
         current_position[Y_AXIS] += float((int)encoderPosition) * move_menu_scale;
386
         current_position[Y_AXIS] += float((int)encoderPosition) * move_menu_scale;
387
-        if (current_position[Y_AXIS] < Y_MIN_POS)
387
+        if (min_software_endstops && current_position[Y_AXIS] < Y_MIN_POS)
388
             current_position[Y_AXIS] = Y_MIN_POS;
388
             current_position[Y_AXIS] = Y_MIN_POS;
389
-        if (current_position[Y_AXIS] > Y_MAX_POS)
389
+        if (max_software_endstops && current_position[Y_AXIS] > Y_MAX_POS)
390
             current_position[Y_AXIS] = Y_MAX_POS;
390
             current_position[Y_AXIS] = Y_MAX_POS;
391
         encoderPosition = 0;
391
         encoderPosition = 0;
392
         plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 600, active_extruder);
392
         plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 600, active_extruder);
408
     if (encoderPosition != 0)
408
     if (encoderPosition != 0)
409
     {
409
     {
410
         current_position[Z_AXIS] += float((int)encoderPosition) * move_menu_scale;
410
         current_position[Z_AXIS] += float((int)encoderPosition) * move_menu_scale;
411
-        if (current_position[Z_AXIS] < Z_MIN_POS)
411
+        if (min_software_endstops && current_position[Z_AXIS] < Z_MIN_POS)
412
             current_position[Z_AXIS] = Z_MIN_POS;
412
             current_position[Z_AXIS] = Z_MIN_POS;
413
-        if (current_position[Z_AXIS] > Z_MAX_POS)
413
+        if (max_software_endstops && current_position[Z_AXIS] > Z_MAX_POS)
414
             current_position[Z_AXIS] = Z_MAX_POS;
414
             current_position[Z_AXIS] = Z_MAX_POS;
415
         encoderPosition = 0;
415
         encoderPosition = 0;
416
         plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], homing_feedrate[Z_AXIS]/60, active_extruder);
416
         plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], homing_feedrate[Z_AXIS]/60, active_extruder);

Loading…
Cancel
Save