Revert simple code changes so only comments have been changed
This commit is contained in:
parent
a7ba369987
commit
8ff3d5322c
@ -236,14 +236,16 @@ void limits_go_home(uint8_t cycle_mask)
|
|||||||
// Check limit state. Lock out cycle axes when they change.
|
// Check limit state. Lock out cycle axes when they change.
|
||||||
limit_state = limits_get_state();
|
limit_state = limits_get_state();
|
||||||
for (idx=0; idx<N_AXIS; idx++) {
|
for (idx=0; idx<N_AXIS; idx++) {
|
||||||
if ((axislock & step_pin[idx]) && (limit_state & (1 << idx))) {
|
if (axislock & step_pin[idx]) {
|
||||||
// Clear the axislock bits to prevent axis from moving after limit is hit
|
if (limit_state & (1 << idx)) {
|
||||||
#ifdef COREXY
|
// Clear the axislock bits to prevent axis from moving after limit is hit
|
||||||
if (idx==Z_AXIS) { axislock &= ~(step_pin[Z_AXIS]); }
|
#ifdef COREXY
|
||||||
else { axislock &= ~(step_pin[A_MOTOR]|step_pin[B_MOTOR]); }
|
if (idx==Z_AXIS) { axislock &= ~(step_pin[Z_AXIS]); }
|
||||||
#else
|
else { axislock &= ~(step_pin[A_MOTOR]|step_pin[B_MOTOR]); }
|
||||||
axislock &= ~(step_pin[idx]);
|
#else
|
||||||
#endif
|
axislock &= ~(step_pin[idx]);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sys.homing_axis_lock = axislock;
|
sys.homing_axis_lock = axislock;
|
||||||
|
@ -249,15 +249,15 @@ void st_go_idle()
|
|||||||
busy = false;
|
busy = false;
|
||||||
|
|
||||||
// Set stepper driver idle state, disabled or enabled, depending on settings and circumstances.
|
// Set stepper driver idle state, disabled or enabled, depending on settings and circumstances.
|
||||||
bool disableStepper = false; // Keep enabled by default.
|
bool pin_state = false; // Stepper is disabled when pin_state is true. Keep enabled by default.
|
||||||
if (((settings.stepper_idle_lock_time != 0xff) || sys_rt_exec_alarm || sys.state == STATE_SLEEP) && sys.state != STATE_HOMING) {
|
if (((settings.stepper_idle_lock_time != 0xff) || sys_rt_exec_alarm || sys.state == STATE_SLEEP) && sys.state != STATE_HOMING) {
|
||||||
// Force stepper dwell to lock axes for a defined amount of time to ensure the axes come to a complete
|
// Force stepper dwell to lock axes for a defined amount of time to ensure the axes come to a complete
|
||||||
// stop and not drift from residual inertial forces at the end of the last movement.
|
// stop and not drift from residual inertial forces at the end of the last movement.
|
||||||
delay_ms(settings.stepper_idle_lock_time);
|
delay_ms(settings.stepper_idle_lock_time);
|
||||||
disableStepper = true; // Override. Disable steppers.
|
pin_state = true; // Override. Disable steppers.
|
||||||
}
|
}
|
||||||
if (bit_istrue(settings.flags,BITFLAG_INVERT_ST_ENABLE)) { disableStepper = !disableStepper; } // Apply pin invert.
|
if (bit_istrue(settings.flags,BITFLAG_INVERT_ST_ENABLE)) { pin_state = !pin_state; } // Apply pin invert.
|
||||||
if (disableStepper) { STEPPERS_DISABLE_PORT |= STEPPERS_DISABLE_MASK; }
|
if (pin_state) { STEPPERS_DISABLE_PORT |= STEPPERS_DISABLE_MASK; }
|
||||||
else { STEPPERS_DISABLE_PORT &= ~STEPPERS_DISABLE_MASK; }
|
else { STEPPERS_DISABLE_PORT &= ~STEPPERS_DISABLE_MASK; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user