stepper: Introduce and use gpio_out_toggle_noirq()
The gpio_out_toggle() function in the sam3x8e and stm32f1 code was only valid if it was called with irqs disabled. Commits018c5daaand9c52ad43enabled the lcd code which called gpio_out_toggle() with irqs enabled. This could cause corruption of the gpio state. Introduce a gpio_out_toggle_noirq() function that will only be invoked with irqs disabled, and fix gpio_out_toggle() on sam3x8e and stm32f1 so that it safe to call even if irqs are enabled. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
@@ -115,7 +115,7 @@ static uint_fast8_t
|
||||
soft_pwm_toggle_event(struct timer *timer)
|
||||
{
|
||||
struct soft_pwm_s *s = container_of(timer, struct soft_pwm_s, timer);
|
||||
gpio_out_toggle(s->pin);
|
||||
gpio_out_toggle_noirq(s->pin);
|
||||
s->flags ^= SPF_ON;
|
||||
uint32_t waketime = s->timer.waketime;
|
||||
if (s->flags & SPF_ON)
|
||||
|
||||
Reference in New Issue
Block a user