File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -1466,26 +1466,28 @@ void set_axis_never_homed(const AxisEnum axis) {
1466
1466
effectorBackoutDir, // Direction in which the effector mm coordinates move away from endstop.
1467
1467
stepperBackoutDir; // Direction in which the TMC µstep count(phase) move away from endstop.
1468
1468
1469
+ #define PHASE_PER_MICROSTEP (N ) (256 / _MAX(1 , N##_MICROSTEPS))
1470
+
1469
1471
switch (axis) {
1470
1472
#ifdef X_MICROSTEPS
1471
1473
case X_AXIS:
1472
- phasePerUStep = 256 / (X_MICROSTEPS );
1474
+ phasePerUStep = PHASE_PER_MICROSTEP (X );
1473
1475
phaseCurrent = stepperX.get_microstep_counter ();
1474
1476
effectorBackoutDir = -X_HOME_DIR;
1475
1477
stepperBackoutDir = INVERT_X_DIR ? effectorBackoutDir : -effectorBackoutDir;
1476
1478
break ;
1477
1479
#endif
1478
1480
#ifdef Y_MICROSTEPS
1479
1481
case Y_AXIS:
1480
- phasePerUStep = 256 / (Y_MICROSTEPS );
1482
+ phasePerUStep = PHASE_PER_MICROSTEP (Y );
1481
1483
phaseCurrent = stepperY.get_microstep_counter ();
1482
1484
effectorBackoutDir = -Y_HOME_DIR;
1483
1485
stepperBackoutDir = INVERT_Y_DIR ? effectorBackoutDir : -effectorBackoutDir;
1484
1486
break ;
1485
1487
#endif
1486
1488
#ifdef Z_MICROSTEPS
1487
1489
case Z_AXIS:
1488
- phasePerUStep = 256 / (Z_MICROSTEPS );
1490
+ phasePerUStep = PHASE_PER_MICROSTEP (Z );
1489
1491
phaseCurrent = stepperZ.get_microstep_counter ();
1490
1492
effectorBackoutDir = -Z_HOME_DIR;
1491
1493
stepperBackoutDir = INVERT_Z_DIR ? effectorBackoutDir : -effectorBackoutDir;
You can’t perform that action at this time.
0 commit comments