Revert simple code changes so only comments have been changed

This commit is contained in:
B. Perry 2019-04-30 08:36:30 -06:00
parent a7ba369987
commit 8ff3d5322c
2 changed files with 14 additions and 12 deletions

View File

@ -236,14 +236,16 @@ void limits_go_home(uint8_t cycle_mask)
// Check limit state. Lock out cycle axes when they change.
limit_state = limits_get_state();
for (idx=0; idx<N_AXIS; idx++) {
if ((axislock & step_pin[idx]) && (limit_state & (1 << idx))) {
// Clear the axislock bits to prevent axis from moving after limit is hit
#ifdef COREXY
if (idx==Z_AXIS) { axislock &= ~(step_pin[Z_AXIS]); }
else { axislock &= ~(step_pin[A_MOTOR]|step_pin[B_MOTOR]); }
#else
axislock &= ~(step_pin[idx]);
#endif
if (axislock & step_pin[idx]) {
if (limit_state & (1 << idx)) {
// Clear the axislock bits to prevent axis from moving after limit is hit
#ifdef COREXY
if (idx==Z_AXIS) { axislock &= ~(step_pin[Z_AXIS]); }
else { axislock &= ~(step_pin[A_MOTOR]|step_pin[B_MOTOR]); }
#else
axislock &= ~(step_pin[idx]);
#endif
}
}
}
sys.homing_axis_lock = axislock;

View File

@ -249,15 +249,15 @@ void st_go_idle()
busy = false;
// 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) {
// 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.
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 (disableStepper) { STEPPERS_DISABLE_PORT |= STEPPERS_DISABLE_MASK; }
if (bit_istrue(settings.flags,BITFLAG_INVERT_ST_ENABLE)) { pin_state = !pin_state; } // Apply pin invert.
if (pin_state) { STEPPERS_DISABLE_PORT |= STEPPERS_DISABLE_MASK; }
else { STEPPERS_DISABLE_PORT &= ~STEPPERS_DISABLE_MASK; }
}