|
@@ -1132,15 +1132,12 @@
|
1132
|
1132
|
SERIAL_PROTOCOLLNPGM("Both X & Y locations must be specified.\n");
|
1133
|
1133
|
err_flag = true;
|
1134
|
1134
|
}
|
1135
|
|
- if (!WITHIN(RAW_X_POSITION(g29_x_pos), X_MIN_BED, X_MAX_BED)) {
|
1136
|
|
- SERIAL_PROTOCOLLNPGM("Invalid X location specified.\n");
|
1137
|
|
- err_flag = true;
|
1138
|
|
- }
|
1139
|
1135
|
|
1140
|
|
- if (!WITHIN(RAW_Y_POSITION(g29_y_pos), Y_MIN_BED, Y_MAX_BED)) {
|
1141
|
|
- SERIAL_PROTOCOLLNPGM("Invalid Y location specified.\n");
|
1142
|
|
- err_flag = true;
|
1143
|
|
- }
|
|
1136
|
+ 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
|
|
1137
|
+ g29_x_pos = (X_MIN_BED + X_MAX_BED) / 2.0;
|
|
1138
|
+
|
|
1139
|
+ 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
|
|
1140
|
+ g29_y_pos = (Y_MIN_BED + Y_MAX_BED) / 2.0;
|
1144
|
1141
|
|
1145
|
1142
|
if (err_flag) return UBL_ERR;
|
1146
|
1143
|
|