upstream merge fix

this fixes the missing changes from #27866 Motion encapsulation
This commit is contained in:
ThomasToka 2026-02-24 10:45:45 +01:00
parent 1c296da402
commit 19f0f07d76
2 changed files with 5 additions and 5 deletions

View file

@ -130,12 +130,12 @@ void GcodeSuite::M421() {
}
if (parser.seen('L')) {
// Left margin: X_MIN_POS + probe_offset must reach >= 0, but min 10
bedlevel.margin_l = safe_margin(parser.value_int(), constrain(((TERN(HAS_HOME_OFFSET, home_offset.x, X_MIN_POS) - ceilf(fabs(probe.offset_xy.x))) <= 0 ? 10 : (TERN(HAS_HOME_OFFSET, home_offset.x, X_MIN_POS) - ceilf(fabs(probe.offset_xy.x)))), 10, X_BED_SIZE), 'L');
bedlevel.margin_l = safe_margin(parser.value_int(), constrain(((TERN(HAS_HOME_OFFSET, motion.home_offset.x, X_MIN_POS) - ceilf(fabs(probe.offset_xy.x))) <= 0 ? 10 : (TERN(HAS_HOME_OFFSET, motion.home_offset.x, X_MIN_POS) - ceilf(fabs(probe.offset_xy.x)))), 10, X_BED_SIZE), 'L');
did_something = true;
}
if (parser.seen('F')) {
// Front margin: Y_MIN_POS + probe_offset must reach >= 0, but min 10
bedlevel.margin_f = safe_margin(parser.value_int(), constrain(((TERN(HAS_HOME_OFFSET, home_offset.y, Y_MIN_POS) - ceilf(fabs(probe.offset_xy.y))) <= 0 ? 10 : (TERN(HAS_HOME_OFFSET, home_offset.y, Y_MIN_POS) - ceilf(fabs(probe.offset_xy.y)))), 10, Y_BED_SIZE), 'F');
bedlevel.margin_f = safe_margin(parser.value_int(), constrain(((TERN(HAS_HOME_OFFSET, motion.home_offset.y, Y_MIN_POS) - ceilf(fabs(probe.offset_xy.y))) <= 0 ? 10 : (TERN(HAS_HOME_OFFSET, motion.home_offset.y, Y_MIN_POS) - ceilf(fabs(probe.offset_xy.y)))), 10, Y_BED_SIZE), 'F');
did_something = true;
}
if (parser.seen('R')) {

View file

@ -74,7 +74,7 @@ void GcodeSuite::M421() {
hasQ = !hasZ && parser.seen('Q');
const bool mesh_command = hasZ || hasQ || hasN;
if (hasC) ij = bedlevel.find_closest_mesh_point_of_type(CLOSEST, current_position);
if (hasC) ij = bedlevel.find_closest_mesh_point_of_type(CLOSEST, motion.position);
bool did_something = false;
// Mesh point modification
if (mesh_command) {
@ -135,12 +135,12 @@ void GcodeSuite::M421() {
}
if (parser.seen('L')) {
// Left margin: X_MIN_POS + probe_offset must reach >= 0, but min 10
bedlevel.margin_l = safe_margin(parser.value_int(), constrain(_MAX(10, TERN(HAS_HOME_OFFSET, home_offset.x, X_MIN_POS) - ceilf(fabs(probe.offset_xy.x))), 10, X_BED_SIZE), 'L');
bedlevel.margin_l = safe_margin(parser.value_int(), constrain(_MAX(10, TERN(HAS_HOME_OFFSET, motion.home_offset.x, X_MIN_POS) - ceilf(fabs(probe.offset_xy.x))), 10, X_BED_SIZE), 'L');
did_something = true;
}
if (parser.seen('F')) {
// Front margin: Y_MIN_POS + probe_offset must reach >= 0, but min 10
bedlevel.margin_f = safe_margin(parser.value_int(), constrain(_MAX(10, TERN(HAS_HOME_OFFSET, home_offset.y, Y_MIN_POS) - ceilf(fabs(probe.offset_xy.y))), 10, Y_BED_SIZE), 'F');
bedlevel.margin_f = safe_margin(parser.value_int(), constrain(_MAX(10, TERN(HAS_HOME_OFFSET, motion.home_offset.y, Y_MIN_POS) - ceilf(fabs(probe.offset_xy.y))), 10, Y_BED_SIZE), 'F');
did_something = true;
}
if (parser.seen('R')) {