stepper: Reset the next step time on a stepper stop

Automatically reset the next step time to zero on a stepper_stop()
call.  This makes the host code simpler as it no longer needs to
schedule an explicit reset_step_clock command on the step after a
homing operation.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2016-11-14 13:10:14 -05:00
parent 941427554a
commit 9ad8153d33
3 changed files with 5 additions and 8 deletions

View file

@ -238,6 +238,7 @@ void
stepper_stop(struct stepper *s)
{
sched_del_timer(&s->time);
s->next_step_time = 0;
s->position = -stepper_get_position(s);
s->count = 0;
s->flags &= SF_INVERT_STEP;