Fix MIN/MAX function collision with macros
This commit is contained in:
@ -301,7 +301,7 @@ float bilinear_z_offset(const float raw[XYZ]) {
|
||||
#endif
|
||||
|
||||
gridx = gx;
|
||||
nextx = MIN(gridx + 1, ABL_BG_POINTS_X - 1);
|
||||
nextx = _MIN(gridx + 1, ABL_BG_POINTS_X - 1);
|
||||
}
|
||||
|
||||
if (last_y != ry || last_gridx != gridx) {
|
||||
@ -318,7 +318,7 @@ float bilinear_z_offset(const float raw[XYZ]) {
|
||||
#endif
|
||||
|
||||
gridy = gy;
|
||||
nexty = MIN(gridy + 1, ABL_BG_POINTS_Y - 1);
|
||||
nexty = _MIN(gridy + 1, ABL_BG_POINTS_Y - 1);
|
||||
}
|
||||
|
||||
if (last_gridx != gridx || last_gridy != gridy) {
|
||||
@ -384,7 +384,7 @@ float bilinear_z_offset(const float raw[XYZ]) {
|
||||
#define LINE_SEGMENT_END(A) (current_position[_AXIS(A)] + (destination[_AXIS(A)] - current_position[_AXIS(A)]) * normalized_dist)
|
||||
|
||||
float normalized_dist, end[XYZE];
|
||||
const int8_t gcx = MAX(cx1, cx2), gcy = MAX(cy1, cy2);
|
||||
const int8_t gcx = _MAX(cx1, cx2), gcy = _MAX(cy1, cy2);
|
||||
|
||||
// Crosses on the X and not already split on this X?
|
||||
// The x_splits flags are insurance against rounding errors.
|
||||
|
@ -222,9 +222,9 @@ void reset_bed_level() {
|
||||
#ifdef MANUAL_PROBE_START_Z
|
||||
#if MANUAL_PROBE_HEIGHT > 0
|
||||
do_blocking_move_to(rx, ry, MANUAL_PROBE_HEIGHT);
|
||||
do_blocking_move_to_z(MAX(0,MANUAL_PROBE_START_Z));
|
||||
do_blocking_move_to_z(_MAX(0,MANUAL_PROBE_START_Z));
|
||||
#else
|
||||
do_blocking_move_to(rx, ry, MAX(0,MANUAL_PROBE_START_Z));
|
||||
do_blocking_move_to(rx, ry, _MAX(0,MANUAL_PROBE_START_Z));
|
||||
#endif
|
||||
#elif MANUAL_PROBE_HEIGHT > 0
|
||||
const float prev_z = current_position[Z_AXIS];
|
||||
|
@ -81,7 +81,7 @@
|
||||
#define MBL_SEGMENT_END(A) (current_position[_AXIS(A)] + (destination[_AXIS(A)] - current_position[_AXIS(A)]) * normalized_dist)
|
||||
|
||||
float normalized_dist, end[XYZE];
|
||||
const int8_t gcx = MAX(cx1, cx2), gcy = MAX(cy1, cy2);
|
||||
const int8_t gcx = _MAX(cx1, cx2), gcy = _MAX(cy1, cy2);
|
||||
|
||||
// Crosses on the X and not already split on this X?
|
||||
// The x_splits flags are insurance against rounding errors.
|
||||
|
@ -213,7 +213,7 @@ class unified_bed_leveling {
|
||||
const float xratio = (rx0 - mesh_index_to_xpos(x1_i)) * (1.0f / (MESH_X_DIST)),
|
||||
z1 = z_values[x1_i][yi];
|
||||
|
||||
return z1 + xratio * (z_values[MIN(x1_i, GRID_MAX_POINTS_X - 2) + 1][yi] - z1); // Don't allow x1_i+1 to be past the end of the array
|
||||
return z1 + xratio * (z_values[_MIN(x1_i, GRID_MAX_POINTS_X - 2) + 1][yi] - z1); // Don't allow x1_i+1 to be past the end of the array
|
||||
// If it is, it is clamped to the last element of the
|
||||
// z_values[][] array and no correction is applied.
|
||||
}
|
||||
@ -242,7 +242,7 @@ class unified_bed_leveling {
|
||||
const float yratio = (ry0 - mesh_index_to_ypos(y1_i)) * (1.0f / (MESH_Y_DIST)),
|
||||
z1 = z_values[xi][y1_i];
|
||||
|
||||
return z1 + yratio * (z_values[xi][MIN(y1_i, GRID_MAX_POINTS_Y - 2) + 1] - z1); // Don't allow y1_i+1 to be past the end of the array
|
||||
return z1 + yratio * (z_values[xi][_MIN(y1_i, GRID_MAX_POINTS_Y - 2) + 1] - z1); // Don't allow y1_i+1 to be past the end of the array
|
||||
// If it is, it is clamped to the last element of the
|
||||
// z_values[][] array and no correction is applied.
|
||||
}
|
||||
@ -268,11 +268,11 @@ class unified_bed_leveling {
|
||||
|
||||
const float z1 = calc_z0(rx0,
|
||||
mesh_index_to_xpos(cx), z_values[cx][cy],
|
||||
mesh_index_to_xpos(cx + 1), z_values[MIN(cx, GRID_MAX_POINTS_X - 2) + 1][cy]);
|
||||
mesh_index_to_xpos(cx + 1), z_values[_MIN(cx, GRID_MAX_POINTS_X - 2) + 1][cy]);
|
||||
|
||||
const float z2 = calc_z0(rx0,
|
||||
mesh_index_to_xpos(cx), z_values[cx][MIN(cy, GRID_MAX_POINTS_Y - 2) + 1],
|
||||
mesh_index_to_xpos(cx + 1), z_values[MIN(cx, GRID_MAX_POINTS_X - 2) + 1][MIN(cy, GRID_MAX_POINTS_Y - 2) + 1]);
|
||||
mesh_index_to_xpos(cx), z_values[cx][_MIN(cy, GRID_MAX_POINTS_Y - 2) + 1],
|
||||
mesh_index_to_xpos(cx + 1), z_values[_MIN(cx, GRID_MAX_POINTS_X - 2) + 1][_MIN(cy, GRID_MAX_POINTS_Y - 2) + 1]);
|
||||
|
||||
float z0 = calc_z0(ry0,
|
||||
mesh_index_to_ypos(cy), z1,
|
||||
|
@ -855,7 +855,7 @@
|
||||
save_ubl_active_state_and_disable(); // Disable bed level correction for probing
|
||||
|
||||
do_blocking_move_to(0.5f * (MESH_MAX_X - (MESH_MIN_X)), 0.5f * (MESH_MAX_Y - (MESH_MIN_Y)), in_height);
|
||||
//, MIN(planner.settings.max_feedrate_mm_s[X_AXIS], planner.settings.max_feedrate_mm_s[Y_AXIS]) * 0.5f);
|
||||
//, _MIN(planner.settings.max_feedrate_mm_s[X_AXIS], planner.settings.max_feedrate_mm_s[Y_AXIS]) * 0.5f);
|
||||
planner.synchronize();
|
||||
|
||||
SERIAL_ECHOPGM("Place shim under nozzle");
|
||||
@ -1385,10 +1385,10 @@
|
||||
#include "../../../libs/vector_3.h"
|
||||
|
||||
void unified_bed_leveling::tilt_mesh_based_on_probed_grid(const bool do_3_pt_leveling) {
|
||||
constexpr int16_t x_min = MAX(MIN_PROBE_X, MESH_MIN_X),
|
||||
x_max = MIN(MAX_PROBE_X, MESH_MAX_X),
|
||||
y_min = MAX(MIN_PROBE_Y, MESH_MIN_Y),
|
||||
y_max = MIN(MAX_PROBE_Y, MESH_MAX_Y);
|
||||
constexpr int16_t x_min = _MAX(MIN_PROBE_X, MESH_MIN_X),
|
||||
x_max = _MIN(MAX_PROBE_X, MESH_MAX_X),
|
||||
y_min = _MAX(MIN_PROBE_Y, MESH_MIN_Y),
|
||||
y_max = _MIN(MAX_PROBE_Y, MESH_MAX_Y);
|
||||
|
||||
bool abort_flag = false;
|
||||
|
||||
@ -1654,7 +1654,7 @@
|
||||
|
||||
SERIAL_ECHOPGM("Extrapolating mesh...");
|
||||
|
||||
const float weight_scaled = weight_factor * MAX(MESH_X_DIST, MESH_Y_DIST);
|
||||
const float weight_scaled = weight_factor * _MAX(MESH_X_DIST, MESH_Y_DIST);
|
||||
|
||||
for (uint8_t jx = 0; jx < GRID_MAX_POINTS_X; jx++)
|
||||
for (uint8_t jy = 0; jy < GRID_MAX_POINTS_Y; jy++)
|
||||
|
Reference in New Issue
Block a user