Browse Source

[2.0.x] fix kill printer (#11260)

This will fix kill message on dual printer with 0 alignment offset
Giuliano 7 years ago
parent
commit
e5ea9d200f
1 changed files with 18 additions and 12 deletions
  1. 18
    12
      Marlin/src/module/motion.cpp

+ 18
- 12
Marlin/src/module/motion.cpp View File

@@ -1369,28 +1369,34 @@ void homeaxis(const AxisEnum axis) {
1369 1369
     #if ENABLED(X_DUAL_ENDSTOPS)
1370 1370
       if (axis == X_AXIS) {
1371 1371
         const float adj = ABS(endstops.x_endstop_adj);
1372
-        if (pos_dir ? (endstops.x_endstop_adj > 0) : (endstops.x_endstop_adj < 0)) stepper.set_x_lock(true); else stepper.set_x2_lock(true);
1373
-        do_homing_move(axis, pos_dir ? -adj : adj);
1374
-        stepper.set_x_lock(false);
1375
-        stepper.set_x2_lock(false);
1372
+        if (adj) {
1373
+          if (pos_dir ? (endstops.x_endstop_adj > 0) : (endstops.x_endstop_adj < 0)) stepper.set_x_lock(true); else stepper.set_x2_lock(true);
1374
+          do_homing_move(axis, pos_dir ? -adj : adj);
1375
+          stepper.set_x_lock(false);
1376
+          stepper.set_x2_lock(false);
1377
+        }
1376 1378
       }
1377 1379
     #endif
1378 1380
     #if ENABLED(Y_DUAL_ENDSTOPS)
1379 1381
       if (axis == Y_AXIS) {
1380 1382
         const float adj = ABS(endstops.y_endstop_adj);
1381
-        if (pos_dir ? (endstops.y_endstop_adj > 0) : (endstops.y_endstop_adj < 0)) stepper.set_y_lock(true); else stepper.set_y2_lock(true);
1382
-        do_homing_move(axis, pos_dir ? -adj : adj);
1383
-        stepper.set_y_lock(false);
1384
-        stepper.set_y2_lock(false);
1383
+        if (adj) {
1384
+          if (pos_dir ? (endstops.y_endstop_adj > 0) : (endstops.y_endstop_adj < 0)) stepper.set_y_lock(true); else stepper.set_y2_lock(true);
1385
+          do_homing_move(axis, pos_dir ? -adj : adj);
1386
+          stepper.set_y_lock(false);
1387
+          stepper.set_y2_lock(false);
1388
+        }
1385 1389
       }
1386 1390
     #endif
1387 1391
     #if ENABLED(Z_DUAL_ENDSTOPS)
1388 1392
       if (axis == Z_AXIS) {
1389 1393
         const float adj = ABS(endstops.z_endstop_adj);
1390
-        if (pos_dir ? (endstops.z_endstop_adj > 0) : (endstops.z_endstop_adj < 0)) stepper.set_z_lock(true); else stepper.set_z2_lock(true);
1391
-        do_homing_move(axis, pos_dir ? -adj : adj);
1392
-        stepper.set_z_lock(false);
1393
-        stepper.set_z2_lock(false);
1394
+        if (adj) {
1395
+          if (pos_dir ? (endstops.z_endstop_adj > 0) : (endstops.z_endstop_adj < 0)) stepper.set_z_lock(true); else stepper.set_z2_lock(true);
1396
+          do_homing_move(axis, pos_dir ? -adj : adj);
1397
+          stepper.set_z_lock(false);
1398
+          stepper.set_z2_lock(false);
1399
+        }
1394 1400
       }
1395 1401
     #endif
1396 1402
     stepper.set_homing_dual_axis(false);

Loading…
Cancel
Save