|
@@ -224,15 +224,14 @@ class unified_bed_leveling {
|
224
|
224
|
}
|
225
|
225
|
#endif
|
226
|
226
|
|
227
|
|
- /**
|
228
|
|
- * The requested location is off the mesh. Check if UBL_Z_RAISE_WHEN_OFF_MESH
|
229
|
|
- * is specified. If so, that value is returned.
|
230
|
|
- */
|
231
|
|
- #if ENABLED(UBL_Z_RAISE_WHEN_OFF_MESH)
|
232
|
|
- return UBL_Z_RAISE_WHEN_OFF_MESH;
|
233
|
|
- #else
|
234
|
|
- return NAN;
|
235
|
|
- #endif
|
|
227
|
+ // The requested location is off the mesh. Return UBL_Z_RAISE_WHEN_OFF_MESH or NAN.
|
|
228
|
+ return (
|
|
229
|
+ #ifdef UBL_Z_RAISE_WHEN_OFF_MESH
|
|
230
|
+ UBL_Z_RAISE_WHEN_OFF_MESH
|
|
231
|
+ #else
|
|
232
|
+ NAN
|
|
233
|
+ #endif
|
|
234
|
+ );
|
236
|
235
|
}
|
237
|
236
|
|
238
|
237
|
const float xratio = (rx0 - mesh_index_to_xpos(x1_i)) * (1.0 / (MESH_X_DIST)),
|
|
@@ -259,15 +258,14 @@ class unified_bed_leveling {
|
259
|
258
|
}
|
260
|
259
|
#endif
|
261
|
260
|
|
262
|
|
- /**
|
263
|
|
- * The requested location is off the mesh. Check if UBL_Z_RAISE_WHEN_OFF_MESH
|
264
|
|
- * is specified. If so, that value is returned.
|
265
|
|
- */
|
266
|
|
- #if ENABLED(UBL_Z_RAISE_WHEN_OFF_MESH)
|
267
|
|
- return UBL_Z_RAISE_WHEN_OFF_MESH;
|
268
|
|
- #else
|
269
|
|
- return NAN;
|
270
|
|
- #endif
|
|
261
|
+ // The requested location is off the mesh. Return UBL_Z_RAISE_WHEN_OFF_MESH or NAN.
|
|
262
|
+ return (
|
|
263
|
+ #ifdef UBL_Z_RAISE_WHEN_OFF_MESH
|
|
264
|
+ UBL_Z_RAISE_WHEN_OFF_MESH
|
|
265
|
+ #else
|
|
266
|
+ NAN
|
|
267
|
+ #endif
|
|
268
|
+ );
|
271
|
269
|
}
|
272
|
270
|
|
273
|
271
|
const float yratio = (ry0 - mesh_index_to_ypos(y1_i)) * (1.0 / (MESH_Y_DIST)),
|
|
@@ -292,9 +290,9 @@ class unified_bed_leveling {
|
292
|
290
|
* Check if the requested location is off the mesh. If so, and
|
293
|
291
|
* UBL_Z_RAISE_WHEN_OFF_MESH is specified, that value is returned.
|
294
|
292
|
*/
|
295
|
|
- #if ENABLED(UBL_Z_RAISE_WHEN_OFF_MESH)
|
|
293
|
+ #ifdef UBL_Z_RAISE_WHEN_OFF_MESH
|
296
|
294
|
if (!WITHIN(rx0, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(ry0, 0, GRID_MAX_POINTS_Y - 1))
|
297
|
|
- return UBL_Z_RAISE_WHEN_OFF_MESHH;
|
|
295
|
+ return UBL_Z_RAISE_WHEN_OFF_MESH;
|
298
|
296
|
#endif
|
299
|
297
|
|
300
|
298
|
const float z1 = calc_z0(rx0,
|