Re-ordered stepper idle function to first disable interrupt.

This commit is contained in:
Sonny Jeon 2011-11-19 10:08:41 -07:00
parent b5cc033150
commit 292fcca67f

View File

@ -92,6 +92,8 @@ void st_wake_up() {
static void st_go_idle() { static void st_go_idle() {
// Cycle finished. Set flag to false. // Cycle finished. Set flag to false.
cycle_start = false; cycle_start = false;
// Disable stepper driver interrupt
TIMSK1 &= ~(1<<OCIE1A);
// 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.
#if STEPPER_IDLE_LOCK_TIME #if STEPPER_IDLE_LOCK_TIME
@ -99,8 +101,6 @@ static void st_go_idle() {
#endif #endif
// Disable steppers by setting stepper disable // Disable steppers by setting stepper disable
STEPPERS_DISABLE_PORT |= (1<<STEPPERS_DISABLE_BIT); STEPPERS_DISABLE_PORT |= (1<<STEPPERS_DISABLE_BIT);
// Disable stepper driver interrupt
TIMSK1 &= ~(1<<OCIE1A);
} }
// Initializes the trapezoid generator from the current block. Called whenever a new // Initializes the trapezoid generator from the current block. Called whenever a new