stepper: Make toggling the step gpio after timer read conditional
On the Linux mcu, toggling the pin after the time is read is not valid. Make that optimization dependent on CONFIG_HAVE_STRICT_TIMING. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
835ec3513d
commit
98192d710f
|
@ -154,9 +154,13 @@ stepper_event(struct timer *t)
|
|||
return stepper_event_nodelay(s);
|
||||
|
||||
// Normal step code - schedule the unstep event
|
||||
if (!CONFIG_HAVE_STRICT_TIMING)
|
||||
gpio_out_toggle_noirq(s->step_pin);
|
||||
uint32_t step_delay = timer_from_us(CONFIG_STEP_DELAY);
|
||||
uint32_t min_next_time = timer_read_time() + step_delay;
|
||||
gpio_out_toggle_noirq(s->step_pin);
|
||||
if (CONFIG_HAVE_STRICT_TIMING)
|
||||
// Toggling gpio after reading the time is a micro-optimization
|
||||
gpio_out_toggle_noirq(s->step_pin);
|
||||
s->count--;
|
||||
if (likely(s->count & 1))
|
||||
// Schedule unstep event
|
||||
|
|
Loading…
Reference in New Issue