|
@@ -267,9 +267,21 @@ void homeaxis(const AxisEnum axis);
|
267
|
267
|
|
268
|
268
|
// Return true if the given position is within the machine bounds.
|
269
|
269
|
inline bool position_is_reachable(const float &rx, const float &ry) {
|
270
|
|
- // Add 0.001 margin to deal with float imprecision
|
271
|
|
- return WITHIN(rx, X_MIN_POS - 0.001f, X_MAX_POS + 0.001f)
|
272
|
|
- && WITHIN(ry, Y_MIN_POS - 0.001f, Y_MAX_POS + 0.001f);
|
|
270
|
+ #if ENABLED(DUAL_X_CARRIAGE)
|
|
271
|
+ if (active_extruder == 0) {
|
|
272
|
+ // Add 0.001 margin to deal with float imprecision
|
|
273
|
+ return WITHIN(rx, X1_MIN_POS - 0.001f, X1_MAX_POS + 0.001f)
|
|
274
|
+ && WITHIN(ry, Y_MIN_POS - 0.001f, Y_MAX_POS + 0.001f);
|
|
275
|
+ } else {
|
|
276
|
+ // Add 0.001 margin to deal with float imprecision
|
|
277
|
+ return WITHIN(rx, X2_MIN_POS - 0.001f, X2_MAX_POS + 0.001f)
|
|
278
|
+ && WITHIN(ry, Y_MIN_POS - 0.001f, Y_MAX_POS + 0.001f);
|
|
279
|
+ }
|
|
280
|
+ #else
|
|
281
|
+ // Add 0.001 margin to deal with float imprecision
|
|
282
|
+ return WITHIN(rx, X_MIN_POS - 0.001f, X_MAX_POS + 0.001f)
|
|
283
|
+ && WITHIN(ry, Y_MIN_POS - 0.001f, Y_MAX_POS + 0.001f);
|
|
284
|
+ #endif
|
273
|
285
|
}
|
274
|
286
|
|
275
|
287
|
#if HAS_BED_PROBE
|