dda.c: endstop stop more reliably.

This commit is contained in:
Markus Hitter 2014-05-24 14:45:28 +02:00
parent 6c6b4b3b3f
commit f51e52e7fa
1 changed files with 4 additions and 2 deletions

6
dda.c
View File

@ -660,7 +660,7 @@ void dda_step(DDA *dda) {
if ((move_state.x_steps == 0 && move_state.y_steps == 0 && if ((move_state.x_steps == 0 && move_state.y_steps == 0 &&
move_state.z_steps == 0 && move_state.e_steps == 0) move_state.z_steps == 0 && move_state.e_steps == 0)
#ifdef ACCELERATION_RAMPING #ifdef ACCELERATION_RAMPING
|| (move_state.endstop_stop && dda->n == 0) || (move_state.endstop_stop && dda->n <= 0)
#endif #endif
) { ) {
dda->live = 0; dda->live = 0;
@ -675,10 +675,12 @@ void dda_step(DDA *dda) {
#endif #endif
// z stepper is only enabled while moving // z stepper is only enabled while moving
z_disable(); z_disable();
// No need to restart timer here.
// After having finished, dda_start() will do it.
} }
else { else {
psu_timeout = 0; psu_timeout = 0;
// After having finished, dda_start() will set the timer.
setTimer(dda->c >> 8); setTimer(dda->c >> 8);
} }