|
@@ -30,6 +30,7 @@
|
30
|
30
|
#include "Marlin.h"
|
31
|
31
|
#include "math.h"
|
32
|
32
|
#include "vector_3.h"
|
|
33
|
+ #include "planner.h"
|
33
|
34
|
|
34
|
35
|
#define UBL_VERSION "1.00"
|
35
|
36
|
#define UBL_OK false
|
|
@@ -97,15 +98,9 @@
|
97
|
98
|
mesh_x_dist = MESH_X_DIST,
|
98
|
99
|
mesh_y_dist = MESH_Y_DIST;
|
99
|
100
|
|
100
|
|
- #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
|
101
|
|
- float g29_correction_fade_height = 10.0,
|
102
|
|
- g29_fade_height_multiplier = 1.0 / 10.0; // It's cheaper to do a floating point multiply than divide,
|
103
|
|
- // so keep this value and its reciprocal.
|
104
|
|
- #endif
|
105
|
|
-
|
106
|
101
|
// If you change this struct, adjust TOTAL_STRUCT_SIZE
|
107
|
102
|
|
108
|
|
- #define TOTAL_STRUCT_SIZE 40 // Total size of the above fields
|
|
103
|
+ #define TOTAL_STRUCT_SIZE 32 // Total size of the above fields
|
109
|
104
|
|
110
|
105
|
// padding provides space to add state variables without
|
111
|
106
|
// changing the location of data structures in the EEPROM.
|
|
@@ -309,21 +304,21 @@
|
309
|
304
|
* This function sets the Z leveling fade factor based on the given Z height,
|
310
|
305
|
* only re-calculating when necessary.
|
311
|
306
|
*
|
312
|
|
- * Returns 1.0 if g29_correction_fade_height is 0.0.
|
|
307
|
+ * Returns 1.0 if planner.z_fade_height is 0.0.
|
313
|
308
|
* Returns 0.0 if Z is past the specified 'Fade Height'.
|
314
|
309
|
*/
|
315
|
310
|
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
|
316
|
311
|
|
317
|
312
|
static FORCE_INLINE float fade_scaling_factor_for_z(const float &lz) {
|
318
|
|
- if (state.g29_correction_fade_height == 0.0) return 1.0;
|
|
313
|
+ if (planner.z_fade_height == 0.0) return 1.0;
|
319
|
314
|
|
320
|
315
|
static float fade_scaling_factor = 1.0;
|
321
|
316
|
const float rz = RAW_Z_POSITION(lz);
|
322
|
317
|
if (last_specified_z != rz) {
|
323
|
318
|
last_specified_z = rz;
|
324
|
319
|
fade_scaling_factor =
|
325
|
|
- rz < state.g29_correction_fade_height
|
326
|
|
- ? 1.0 - (rz * state.g29_fade_height_multiplier)
|
|
320
|
+ rz < planner.z_fade_height
|
|
321
|
+ ? 1.0 - (rz * planner.inverse_z_fade_height)
|
327
|
322
|
: 0.0;
|
328
|
323
|
}
|
329
|
324
|
return fade_scaling_factor;
|