|
@@ -1272,6 +1272,7 @@ XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR);
|
1272
|
1272
|
*/
|
1273
|
1273
|
static void update_software_endstops(AxisEnum axis) {
|
1274
|
1274
|
float offs = home_offset[axis] + position_shift[axis];
|
|
1275
|
+
|
1275
|
1276
|
#if ENABLED(DUAL_X_CARRIAGE)
|
1276
|
1277
|
if (axis == X_AXIS) {
|
1277
|
1278
|
float dual_max_x = max(extruder_offset[X_AXIS][1], X2_MAX_POS);
|
|
@@ -1292,6 +1293,7 @@ static void update_software_endstops(AxisEnum axis) {
|
1292
|
1293
|
sw_endstop_min[axis] = base_min_pos(axis) + offs;
|
1293
|
1294
|
sw_endstop_max[axis] = base_max_pos(axis) + offs;
|
1294
|
1295
|
}
|
|
1296
|
+
|
1295
|
1297
|
}
|
1296
|
1298
|
|
1297
|
1299
|
/**
|
|
@@ -6472,24 +6474,29 @@ inline void gcode_T(uint8_t tmp_extruder) {
|
6472
|
6474
|
|
6473
|
6475
|
#else // !AUTO_BED_LEVELING_FEATURE
|
6474
|
6476
|
|
6475
|
|
- // Offset extruder (only by XY)
|
6476
|
|
- for (int i=X_AXIS; i<=Y_AXIS; i++)
|
6477
|
|
- current_position[i] += extruder_offset[i][tmp_extruder] - extruder_offset[i][active_extruder];
|
|
6477
|
+ // The newly-selected extruder is actually at...
|
|
6478
|
+ for (int i=X_AXIS; i<=Y_AXIS; i++) {
|
|
6479
|
+ float diff = extruder_offset[i][tmp_extruder] - extruder_offset[i][active_extruder];
|
|
6480
|
+ current_position[i] += diff;
|
|
6481
|
+ position_shift[i] += diff; // Offset the coordinate space
|
|
6482
|
+ update_software_endstops((AxisEnum)i);
|
|
6483
|
+ }
|
6478
|
6484
|
|
6479
|
6485
|
#endif // !AUTO_BED_LEVELING_FEATURE
|
6480
|
6486
|
|
6481
|
|
- // Set the new active extruder and position
|
|
6487
|
+ // Set the new active extruder
|
6482
|
6488
|
active_extruder = tmp_extruder;
|
6483
|
6489
|
|
6484
|
6490
|
#endif // !DUAL_X_CARRIAGE
|
6485
|
6491
|
|
|
6492
|
+ // Tell the planner the new "current position"
|
6486
|
6493
|
#if ENABLED(DELTA)
|
6487
|
6494
|
sync_plan_position_delta();
|
6488
|
6495
|
#else
|
6489
|
6496
|
sync_plan_position();
|
6490
|
6497
|
#endif
|
6491
|
6498
|
|
6492
|
|
- // Move to the old position
|
|
6499
|
+ // Move to the "old position" (move the extruder into place)
|
6493
|
6500
|
if (IsRunning()) prepare_move();
|
6494
|
6501
|
|
6495
|
6502
|
} // (tmp_extruder != active_extruder)
|
|
@@ -7187,23 +7194,8 @@ void clamp_to_software_endstops(float target[3]) {
|
7187
|
7194
|
if (min_software_endstops) {
|
7188
|
7195
|
NOLESS(target[X_AXIS], sw_endstop_min[X_AXIS]);
|
7189
|
7196
|
NOLESS(target[Y_AXIS], sw_endstop_min[Y_AXIS]);
|
7190
|
|
-
|
7191
|
|
- float negative_z_offset = 0;
|
7192
|
|
- #if ENABLED(AUTO_BED_LEVELING_FEATURE)
|
7193
|
|
- if (zprobe_zoffset < 0) negative_z_offset += zprobe_zoffset;
|
7194
|
|
- if (home_offset[Z_AXIS] < 0) {
|
7195
|
|
- #if ENABLED(DEBUG_LEVELING_FEATURE)
|
7196
|
|
- if (DEBUGGING(LEVELING)) {
|
7197
|
|
- SERIAL_ECHOPAIR("> clamp_to_software_endstops > Add home_offset[Z_AXIS]:", home_offset[Z_AXIS]);
|
7198
|
|
- SERIAL_EOL;
|
7199
|
|
- }
|
7200
|
|
- #endif
|
7201
|
|
- negative_z_offset += home_offset[Z_AXIS];
|
7202
|
|
- }
|
7203
|
|
- #endif
|
7204
|
|
- NOLESS(target[Z_AXIS], sw_endstop_min[Z_AXIS] + negative_z_offset);
|
|
7197
|
+ NOLESS(target[Z_AXIS], sw_endstop_min[Z_AXIS]);
|
7205
|
7198
|
}
|
7206
|
|
-
|
7207
|
7199
|
if (max_software_endstops) {
|
7208
|
7200
|
NOMORE(target[X_AXIS], sw_endstop_max[X_AXIS]);
|
7209
|
7201
|
NOMORE(target[Y_AXIS], sw_endstop_max[Y_AXIS]);
|