mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-12-30 03:10:27 -07:00
stepper: Ensure minimum time between step pin and dir pin change
Commit8faed8d9made it possible to utilize stepper_event_full() while utilizing tmc "step on both edges" optimation. That commit would ensure a minimum step pulse duration, but it did not ensure a minimum duration between step pin and dir pin changes. Commits0d27195fand554ae78doptimized the gpio handling on stm32h7 chips, which could potentially cause a very small amount of time between step pin and dir pin changes. Enforce a minimum time after a step pin update before updating the dir pin. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
efabe63357
commit
885f63cff0
1 changed files with 4 additions and 0 deletions
|
|
@ -109,6 +109,10 @@ stepper_load_next(struct stepper *s)
|
|||
shutdown("Stepper too far in past");
|
||||
s->time.waketime = min_next_time;
|
||||
}
|
||||
if (was_active && need_dir_change && s->flags & SF_SINGLE_SCHED)
|
||||
// Must ensure minimum time between step change and dir change
|
||||
while (timer_is_before(timer_read_time(), min_next_time))
|
||||
;
|
||||
}
|
||||
|
||||
// Set new direction (if needed)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue