Browse Source

Use [XY]_CENTER for error correction

Followup to #7512
Scott Lahteine 7 years ago
parent
commit
6772e33ef6
1 changed files with 3 additions and 5 deletions
  1. 3
    5
      Marlin/ubl_G29.cpp

+ 3
- 5
Marlin/ubl_G29.cpp View File

1133
       err_flag = true;
1133
       err_flag = true;
1134
     }
1134
     }
1135
 
1135
 
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;
1136
+    // If X or Y are not valid, use center of the bed values
1137
+    if (!WITHIN(RAW_X_POSITION(g29_x_pos), X_MIN_BED, X_MAX_BED)) g29_x_pos = LOGICAL_X_POSITION(X_CENTER);
1138
+    if (!WITHIN(RAW_Y_POSITION(g29_y_pos), Y_MIN_BED, Y_MAX_BED)) g29_y_pos = LOGICAL_Y_POSITION(Y_CENTER);
1141
 
1139
 
1142
     if (err_flag) return UBL_ERR;
1140
     if (err_flag) return UBL_ERR;
1143
 
1141
 

Loading…
Cancel
Save