From 9dd101c26fff95e596039d6168d4ad25e080071c Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Wed, 8 Jun 2016 20:51:00 -0400 Subject: irq: Prefer irq_disable/enable instead of irq_save/restore in cmds/tasks Task and command handlers always run with irqs enabled, so it is not necessary to save/restore the irq state when disabling irqs in these handlers. Signed-off-by: Kevin O'Connor --- src/stepper.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/stepper.c') diff --git a/src/stepper.c b/src/stepper.c index 9dedaf45..0d4754f9 100644 --- a/src/stepper.c +++ b/src/stepper.c @@ -8,7 +8,7 @@ #include "autoconf.h" // CONFIG_* #include "basecmd.h" // alloc_oid #include "board/gpio.h" // gpio_out_write -#include "board/irq.h" // irq_save +#include "board/irq.h" // irq_disable #include "command.h" // DECL_COMMAND #include "sched.h" // struct timer #include "stepper.h" // command_config_stepper @@ -113,7 +113,7 @@ command_queue_step(uint32_t *args) m->next = NULL; m->flags = 0; - uint8_t flag = irq_save(); + irq_disable(); if (!!(s->flags & SF_LAST_DIR) != !!(s->flags & SF_NEXT_DIR)) { s->flags ^= SF_LAST_DIR; m->flags |= MF_DIR; @@ -129,7 +129,7 @@ command_queue_step(uint32_t *args) stepper_load_next(s); sched_timer(&s->time); } - irq_restore(flag); + irq_enable(); } DECL_COMMAND(command_queue_step, "queue_step oid=%c interval=%u count=%hu add=%hi"); -- cgit v1.2.3-70-g09d2