aboutsummaryrefslogtreecommitdiffstats
path: root/src/stepper.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2016-06-08 20:51:00 -0400
committerKevin O'Connor <kevin@koconnor.net>2016-06-13 23:18:59 -0400
commit9dd101c26fff95e596039d6168d4ad25e080071c (patch)
treede4878a531f087d29edb0a164136bacb7504474a /src/stepper.c
parent4fcf5a31f5c6d84749b3ae85be9482161fd33815 (diff)
downloadkutter-9dd101c26fff95e596039d6168d4ad25e080071c.tar.gz
kutter-9dd101c26fff95e596039d6168d4ad25e080071c.tar.xz
kutter-9dd101c26fff95e596039d6168d4ad25e080071c.zip
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 <kevin@koconnor.net>
Diffstat (limited to 'src/stepper.c')
-rw-r--r--src/stepper.c6
1 files changed, 3 insertions, 3 deletions
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");