mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2025-03-01 12:27:13 +00:00
Followup to #9663
`ENABLED` only works for flag type options. Floats must use `#ifdef`.
This commit is contained in:
parent
b56c6b9e13
commit
2ec90d2162
3 changed files with 25 additions and 26 deletions
|
@ -990,7 +990,7 @@
|
||||||
#define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle
|
#define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle
|
||||||
#define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500
|
#define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500
|
||||||
|
|
||||||
//#define UBL_Z_RAISE_WHEN_OFF_MESH 2.51// When the nozzle is off the mesh, this value is used
|
//#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used
|
||||||
// as the Z-Height correction value.
|
// as the Z-Height correction value.
|
||||||
#elif ENABLED(MESH_BED_LEVELING)
|
#elif ENABLED(MESH_BED_LEVELING)
|
||||||
|
|
||||||
|
|
38
Marlin/ubl.h
38
Marlin/ubl.h
|
@ -222,15 +222,14 @@
|
||||||
SERIAL_EOL();
|
SERIAL_EOL();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/**
|
// The requested location is off the mesh. Return UBL_Z_RAISE_WHEN_OFF_MESH or NAN.
|
||||||
* The requested location is off the mesh. Check if UBL_Z_RAISE_WHEN_OFF_MESH
|
return (
|
||||||
* is specified. If so, that value is returned.
|
#ifdef UBL_Z_RAISE_WHEN_OFF_MESH
|
||||||
*/
|
UBL_Z_RAISE_WHEN_OFF_MESH
|
||||||
#if ENABLED(UBL_Z_RAISE_WHEN_OFF_MESH)
|
#else
|
||||||
return UBL_Z_RAISE_WHEN_OFF_MESH;
|
NAN
|
||||||
#else
|
#endif
|
||||||
return NAN;
|
);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const float xratio = (rx0 - mesh_index_to_xpos(x1_i)) * (1.0 / (MESH_X_DIST)),
|
const float xratio = (rx0 - mesh_index_to_xpos(x1_i)) * (1.0 / (MESH_X_DIST)),
|
||||||
|
@ -256,15 +255,14 @@
|
||||||
SERIAL_EOL();
|
SERIAL_EOL();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/**
|
// The requested location is off the mesh. Return UBL_Z_RAISE_WHEN_OFF_MESH or NAN.
|
||||||
* The requested location is off the mesh. Check if UBL_Z_RAISE_WHEN_OFF_MESH
|
return (
|
||||||
* is specified. If so, that value is returned.
|
#ifdef UBL_Z_RAISE_WHEN_OFF_MESH
|
||||||
*/
|
UBL_Z_RAISE_WHEN_OFF_MESH
|
||||||
#if ENABLED(UBL_Z_RAISE_WHEN_OFF_MESH)
|
#else
|
||||||
return UBL_Z_RAISE_WHEN_OFF_MESH;
|
NAN
|
||||||
#else
|
#endif
|
||||||
return NAN;
|
);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const float yratio = (ry0 - mesh_index_to_ypos(y1_i)) * (1.0 / (MESH_Y_DIST)),
|
const float yratio = (ry0 - mesh_index_to_ypos(y1_i)) * (1.0 / (MESH_Y_DIST)),
|
||||||
|
@ -289,9 +287,9 @@
|
||||||
* Check if the requested location is off the mesh. If so, and
|
* Check if the requested location is off the mesh. If so, and
|
||||||
* UBL_Z_RAISE_WHEN_OFF_MESH is specified, that value is returned.
|
* UBL_Z_RAISE_WHEN_OFF_MESH is specified, that value is returned.
|
||||||
*/
|
*/
|
||||||
#if ENABLED(UBL_Z_RAISE_WHEN_OFF_MESH)
|
#ifdef UBL_Z_RAISE_WHEN_OFF_MESH
|
||||||
if (!WITHIN(rx0, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(ry0, 0, GRID_MAX_POINTS_Y - 1))
|
if (!WITHIN(rx0, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(ry0, 0, GRID_MAX_POINTS_Y - 1))
|
||||||
return UBL_Z_RAISE_WHEN_OFF_MESHH;
|
return UBL_Z_RAISE_WHEN_OFF_MESH;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const float z1 = calc_z0(rx0,
|
const float z1 = calc_z0(rx0,
|
||||||
|
|
|
@ -82,10 +82,11 @@
|
||||||
// a reasonable correction would be. If the user has specified a UBL_Z_RAISE_WHEN_OFF_MESH
|
// a reasonable correction would be. If the user has specified a UBL_Z_RAISE_WHEN_OFF_MESH
|
||||||
// value, that will be used instead of a calculated (Bi-Linear interpolation) correction.
|
// value, that will be used instead of a calculated (Bi-Linear interpolation) correction.
|
||||||
|
|
||||||
float z_raise = 0.0;
|
const float z_raise = 0.0
|
||||||
#if ENABLED(UBL_Z_RAISE_WHEN_OFF_MESH)
|
#ifdef UBL_Z_RAISE_WHEN_OFF_MESH
|
||||||
z_raise = UBL_Z_RAISE_WHEN_OFF_MESH;
|
+ UBL_Z_RAISE_WHEN_OFF_MESH
|
||||||
#endif
|
#endif
|
||||||
|
;
|
||||||
planner.buffer_segment(end[X_AXIS], end[Y_AXIS], end[Z_AXIS] + z_raise, end[E_AXIS], feed_rate, extruder);
|
planner.buffer_segment(end[X_AXIS], end[Y_AXIS], end[Z_AXIS] + z_raise, end[E_AXIS], feed_rate, extruder);
|
||||||
set_current_from_destination();
|
set_current_from_destination();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue