Smarter MIN, MAX, ABS macros
Use macros that explicitly avoid double-evaluation and can be used for any datatype, replacing `min`, `max`, `abs`, `fabs`, `labs`, and `FABS`. Co-Authored-By: ejtagle <ejtagle@hotmail.com>
This commit is contained in:
@ -79,7 +79,7 @@
|
||||
do_blocking_move_to(start.x, start.y, start.z);
|
||||
|
||||
const uint8_t zigs = objects << 1;
|
||||
const bool horiz = FABS(diffx) >= FABS(diffy); // Do a horizontal wipe?
|
||||
const bool horiz = ABS(diffx) >= ABS(diffy); // Do a horizontal wipe?
|
||||
const float P = (horiz ? diffx : diffy) / zigs; // Period of each zig / zag
|
||||
const point_t *side;
|
||||
for (uint8_t j = 0; j < strokes; j++) {
|
||||
@ -172,11 +172,11 @@
|
||||
break;
|
||||
|
||||
case 2: // Raise by Z-park height
|
||||
do_blocking_move_to_z(min(current_position[Z_AXIS] + park.z, Z_MAX_POS), fr_z);
|
||||
do_blocking_move_to_z(MIN(current_position[Z_AXIS] + park.z, Z_MAX_POS), fr_z);
|
||||
break;
|
||||
|
||||
default: // Raise to at least the Z-park height
|
||||
do_blocking_move_to_z(max(park.z, current_position[Z_AXIS]), fr_z);
|
||||
do_blocking_move_to_z(MAX(park.z, current_position[Z_AXIS]), fr_z);
|
||||
}
|
||||
|
||||
do_blocking_move_to_xy(park.x, park.y, fr_xy);
|
||||
|
Reference in New Issue
Block a user