Replace MIN# / MAX# with variadic MIN / MAX (#11960)
This commit is contained in:
committed by
Scott Lahteine
parent
e10f730478
commit
b30ca652ae
@ -1541,7 +1541,7 @@ void homeaxis(const AxisEnum axis) {
|
||||
case X_AXIS:
|
||||
case Y_AXIS:
|
||||
// Get a minimum radius for clamping
|
||||
soft_endstop_radius = MIN3(ABS(MAX(soft_endstop_min[X_AXIS], soft_endstop_min[Y_AXIS])), soft_endstop_max[X_AXIS], soft_endstop_max[Y_AXIS]);
|
||||
soft_endstop_radius = MIN(ABS(MAX(soft_endstop_min[X_AXIS], soft_endstop_min[Y_AXIS])), soft_endstop_max[X_AXIS], soft_endstop_max[Y_AXIS]);
|
||||
soft_endstop_radius_2 = sq(soft_endstop_radius);
|
||||
break;
|
||||
#endif
|
||||
|
@ -1762,7 +1762,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
||||
#endif
|
||||
|
||||
block->steps[E_AXIS] = esteps;
|
||||
block->step_event_count = MAX4(block->steps[A_AXIS], block->steps[B_AXIS], block->steps[C_AXIS], esteps);
|
||||
block->step_event_count = MAX(block->steps[A_AXIS], block->steps[B_AXIS], block->steps[C_AXIS], esteps);
|
||||
|
||||
// Bail if this is a zero-length block
|
||||
if (block->step_event_count < MIN_STEPS_PER_SEGMENT) return false;
|
||||
@ -2120,8 +2120,8 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
||||
}
|
||||
ys0 = axis_segment_time_us[Y_AXIS][0] = ys0 + segment_time_us;
|
||||
|
||||
const uint32_t max_x_segment_time = MAX3(xs0, xs1, xs2),
|
||||
max_y_segment_time = MAX3(ys0, ys1, ys2),
|
||||
const uint32_t max_x_segment_time = MAX(xs0, xs1, xs2),
|
||||
max_y_segment_time = MAX(ys0, ys1, ys2),
|
||||
min_xy_segment_time = MIN(max_x_segment_time, max_y_segment_time);
|
||||
if (min_xy_segment_time < MAX_FREQ_TIME_US) {
|
||||
const float low_sf = speed_factor * min_xy_segment_time / (MAX_FREQ_TIME_US);
|
||||
@ -2354,7 +2354,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
||||
}
|
||||
|
||||
// Get the lowest speed
|
||||
vmax_junction_sqr = MIN3(vmax_junction_sqr, block->nominal_speed_sqr, previous_nominal_speed_sqr);
|
||||
vmax_junction_sqr = MIN(vmax_junction_sqr, block->nominal_speed_sqr, previous_nominal_speed_sqr);
|
||||
}
|
||||
else // Init entry speed to zero. Assume it starts from rest. Planner will correct this later.
|
||||
vmax_junction_sqr = 0;
|
||||
|
Reference in New Issue
Block a user