|
@@ -1052,9 +1052,14 @@ static void do_homing_move(const AxisEnum axis, const float distance, const floa
|
1052
|
1052
|
if (DEBUGGING(LEVELING)) {
|
1053
|
1053
|
SERIAL_ECHOPAIR(">>> do_homing_move(", axis_codes[axis]);
|
1054
|
1054
|
SERIAL_ECHOPAIR(", ", distance);
|
1055
|
|
- SERIAL_ECHOPAIR(", ", fr_mm_s);
|
1056
|
|
- SERIAL_ECHOPAIR(" [", fr_mm_s ? fr_mm_s : homing_feedrate(axis));
|
1057
|
|
- SERIAL_ECHOLNPGM("])");
|
|
1055
|
+ SERIAL_ECHOPGM(", ");
|
|
1056
|
+ if (fr_mm_s)
|
|
1057
|
+ SERIAL_ECHO(fr_mm_s);
|
|
1058
|
+ else {
|
|
1059
|
+ SERIAL_ECHOPAIR("[", homing_feedrate(axis));
|
|
1060
|
+ SERIAL_CHAR(']');
|
|
1061
|
+ }
|
|
1062
|
+ SERIAL_ECHOLNPGM(")");
|
1058
|
1063
|
}
|
1059
|
1064
|
#endif
|
1060
|
1065
|
|
|
@@ -1262,11 +1267,12 @@ void homeaxis(const AxisEnum axis) {
|
1262
|
1267
|
}
|
1263
|
1268
|
#endif
|
1264
|
1269
|
|
1265
|
|
- const int axis_home_dir =
|
|
1270
|
+ const int axis_home_dir = (
|
1266
|
1271
|
#if ENABLED(DUAL_X_CARRIAGE)
|
1267
|
|
- (axis == X_AXIS) ? x_home_dir(active_extruder) :
|
|
1272
|
+ axis == X_AXIS ? x_home_dir(active_extruder) :
|
1268
|
1273
|
#endif
|
1269
|
|
- home_dir(axis);
|
|
1274
|
+ home_dir(axis)
|
|
1275
|
+ );
|
1270
|
1276
|
|
1271
|
1277
|
// Homing Z towards the bed? Deploy the Z probe or endstop.
|
1272
|
1278
|
#if HOMING_Z_WITH_PROBE
|
|
@@ -1274,14 +1280,20 @@ void homeaxis(const AxisEnum axis) {
|
1274
|
1280
|
#endif
|
1275
|
1281
|
|
1276
|
1282
|
// Set flags for X, Y, Z motor locking
|
1277
|
|
- #if ENABLED(X_DUAL_ENDSTOPS)
|
1278
|
|
- if (axis == X_AXIS) stepper.set_homing_flag_x(true);
|
1279
|
|
- #endif
|
1280
|
|
- #if ENABLED(Y_DUAL_ENDSTOPS)
|
1281
|
|
- if (axis == Y_AXIS) stepper.set_homing_flag_y(true);
|
1282
|
|
- #endif
|
1283
|
|
- #if ENABLED(Z_DUAL_ENDSTOPS)
|
1284
|
|
- if (axis == Z_AXIS) stepper.set_homing_flag_z(true);
|
|
1283
|
+ #if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS)
|
|
1284
|
+ switch (axis) {
|
|
1285
|
+ #if ENABLED(X_DUAL_ENDSTOPS)
|
|
1286
|
+ case X_AXIS:
|
|
1287
|
+ #endif
|
|
1288
|
+ #if ENABLED(Y_DUAL_ENDSTOPS)
|
|
1289
|
+ case Y_AXIS:
|
|
1290
|
+ #endif
|
|
1291
|
+ #if ENABLED(Z_DUAL_ENDSTOPS)
|
|
1292
|
+ case Z_AXIS:
|
|
1293
|
+ #endif
|
|
1294
|
+ stepper.set_homing_dual_axis(true);
|
|
1295
|
+ default: break;
|
|
1296
|
+ }
|
1285
|
1297
|
#endif
|
1286
|
1298
|
|
1287
|
1299
|
// Fast move towards endstop until triggered
|
|
@@ -1321,37 +1333,32 @@ void homeaxis(const AxisEnum axis) {
|
1321
|
1333
|
const bool pos_dir = axis_home_dir > 0;
|
1322
|
1334
|
#if ENABLED(X_DUAL_ENDSTOPS)
|
1323
|
1335
|
if (axis == X_AXIS) {
|
1324
|
|
- const bool lock_x1 = pos_dir ? (endstops.x_endstop_adj > 0) : (endstops.x_endstop_adj < 0);
|
1325
|
|
- float adj = ABS(endstops.x_endstop_adj);
|
1326
|
|
- if (pos_dir) adj = -adj;
|
1327
|
|
- if (lock_x1) stepper.set_x_lock(true); else stepper.set_x2_lock(true);
|
1328
|
|
- do_homing_move(axis, adj);
|
1329
|
|
- if (lock_x1) stepper.set_x_lock(false); else stepper.set_x2_lock(false);
|
1330
|
|
- stepper.set_homing_flag_x(false);
|
|
1336
|
+ const float adj = ABS(endstops.x_endstop_adj);
|
|
1337
|
+ if (pos_dir ? (endstops.x_endstop_adj > 0) : (endstops.x_endstop_adj < 0)) stepper.set_x_lock(true); else stepper.set_x2_lock(true);
|
|
1338
|
+ do_homing_move(axis, pos_dir ? adj : -adj);
|
|
1339
|
+ stepper.set_x_lock(false);
|
|
1340
|
+ stepper.set_x2_lock(false);
|
1331
|
1341
|
}
|
1332
|
1342
|
#endif
|
1333
|
1343
|
#if ENABLED(Y_DUAL_ENDSTOPS)
|
1334
|
1344
|
if (axis == Y_AXIS) {
|
1335
|
|
- const bool lock_y1 = pos_dir ? (endstops.y_endstop_adj > 0) : (endstops.y_endstop_adj < 0);
|
1336
|
|
- float adj = ABS(endstops.y_endstop_adj);
|
1337
|
|
- if (pos_dir) adj = -adj;
|
1338
|
|
- if (lock_y1) stepper.set_y_lock(true); else stepper.set_y2_lock(true);
|
1339
|
|
- do_homing_move(axis, adj);
|
1340
|
|
- if (lock_y1) stepper.set_y_lock(false); else stepper.set_y2_lock(false);
|
1341
|
|
- stepper.set_homing_flag_y(false);
|
|
1345
|
+ const float adj = ABS(endstops.y_endstop_adj);
|
|
1346
|
+ if (pos_dir ? (endstops.y_endstop_adj > 0) : (endstops.y_endstop_adj < 0)) stepper.set_y_lock(true); else stepper.set_y2_lock(true);
|
|
1347
|
+ do_homing_move(axis, pos_dir ? adj : -adj);
|
|
1348
|
+ stepper.set_y_lock(false);
|
|
1349
|
+ stepper.set_y2_lock(false);
|
1342
|
1350
|
}
|
1343
|
1351
|
#endif
|
1344
|
1352
|
#if ENABLED(Z_DUAL_ENDSTOPS)
|
1345
|
1353
|
if (axis == Z_AXIS) {
|
1346
|
|
- const bool lock_z1 = pos_dir ? (endstops.z_endstop_adj > 0) : (endstops.z_endstop_adj < 0);
|
1347
|
|
- float adj = ABS(endstops.z_endstop_adj);
|
1348
|
|
- if (pos_dir) adj = -adj;
|
1349
|
|
- if (lock_z1) stepper.set_z_lock(true); else stepper.set_z2_lock(true);
|
1350
|
|
- do_homing_move(axis, adj);
|
1351
|
|
- if (lock_z1) stepper.set_z_lock(false); else stepper.set_z2_lock(false);
|
1352
|
|
- stepper.set_homing_flag_z(false);
|
|
1354
|
+ const float adj = ABS(endstops.z_endstop_adj);
|
|
1355
|
+ if (pos_dir ? (endstops.z_endstop_adj > 0) : (endstops.z_endstop_adj < 0)) stepper.set_z_lock(true); else stepper.set_z2_lock(true);
|
|
1356
|
+ do_homing_move(axis, pos_dir ? adj : -adj);
|
|
1357
|
+ stepper.set_z_lock(false);
|
|
1358
|
+ stepper.set_z2_lock(false);
|
1353
|
1359
|
}
|
1354
|
1360
|
#endif
|
|
1361
|
+ stepper.set_homing_dual_axis(false);
|
1355
|
1362
|
#endif
|
1356
|
1363
|
|
1357
|
1364
|
#if IS_SCARA
|
|
@@ -1393,10 +1400,9 @@ void homeaxis(const AxisEnum axis) {
|
1393
|
1400
|
if (axis == Z_AXIS && STOW_PROBE()) return;
|
1394
|
1401
|
#endif
|
1395
|
1402
|
|
1396
|
|
- // Clear z_lift if homing the Z axis
|
|
1403
|
+ // Clear retracted status if homing the Z axis
|
1397
|
1404
|
#if ENABLED(FWRETRACT)
|
1398
|
|
- if (axis == Z_AXIS)
|
1399
|
|
- fwretract.hop_amount = 0.0;
|
|
1405
|
+ if (axis == Z_AXIS) fwretract.hop_amount = 0.0;
|
1400
|
1406
|
#endif
|
1401
|
1407
|
|
1402
|
1408
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
|
@@ -1470,7 +1476,7 @@ void homeaxis(const AxisEnum axis) {
|
1470
|
1476
|
#endif
|
1471
|
1477
|
|
1472
|
1478
|
#if ENABLED(DELTA)
|
1473
|
|
- switch(axis) {
|
|
1479
|
+ switch (axis) {
|
1474
|
1480
|
#if HAS_SOFTWARE_ENDSTOPS
|
1475
|
1481
|
case X_AXIS:
|
1476
|
1482
|
case Y_AXIS:
|