♻️ Refactor axis counts and loops

This commit is contained in:
Scott Lahteine
2021-05-18 22:51:19 -05:00
committed by Scott Lahteine
parent f7d28ce1d6
commit 26a244325b
45 changed files with 178 additions and 165 deletions

View File

@@ -38,7 +38,7 @@ inline void G38_single_probe(const uint8_t move_value) {
planner.synchronize();
G38_move = 0;
endstops.hit_on_purpose();
set_current_from_steppers_for_axis(ALL_AXES);
set_current_from_steppers_for_axis(ALL_AXES_MASK);
sync_plan_position();
}
@@ -49,7 +49,7 @@ inline bool G38_run_probe() {
#if MULTIPLE_PROBING > 1
// Get direction of move and retract
xyz_float_t retract_mm;
LOOP_XYZ(i) {
LOOP_LINEAR_AXES(i) {
const float dist = destination[i] - current_position[i];
retract_mm[i] = ABS(dist) < G38_MINIMUM_MOVE ? 0 : home_bump_mm((AxisEnum)i) * (dist > 0 ? -1 : 1);
}
@@ -119,7 +119,7 @@ void GcodeSuite::G38(const int8_t subcode) {
;
// If any axis has enough movement, do the move
LOOP_XYZ(i)
LOOP_LINEAR_AXES(i)
if (ABS(destination[i] - current_position[i]) >= G38_MINIMUM_MOVE) {
if (!parser.seenval('F')) feedrate_mm_s = homing_feedrate((AxisEnum)i);
// If G38.2 fails throw an error