Use [XY]_CENTER for error correction

Followup to #7512
This commit is contained in:
Scott Lahteine 2017-08-16 00:59:30 -05:00
parent 385f1bb9e5
commit 6772e33ef6

View File

@ -1133,11 +1133,9 @@
err_flag = true;
}
if (!WITHIN(RAW_X_POSITION(g29_x_pos), X_MIN_BED, X_MAX_BED)) // if X & Y are not valid, use center of the bed values
g29_x_pos = (X_MIN_BED + X_MAX_BED) / 2.0;
if (!WITHIN(RAW_Y_POSITION(g29_y_pos), Y_MIN_BED, Y_MAX_BED)) // if X & Y are not valid, use center of the bed values
g29_y_pos = (Y_MIN_BED + Y_MAX_BED) / 2.0;
// If X or Y are not valid, use center of the bed values
if (!WITHIN(RAW_X_POSITION(g29_x_pos), X_MIN_BED, X_MAX_BED)) g29_x_pos = LOGICAL_X_POSITION(X_CENTER);
if (!WITHIN(RAW_Y_POSITION(g29_y_pos), Y_MIN_BED, Y_MAX_BED)) g29_y_pos = LOGICAL_Y_POSITION(Y_CENTER);
if (err_flag) return UBL_ERR;