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/endstop.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/endstop.c') diff --git a/src/endstop.c b/src/endstop.c index bc177605..6f155cda 100644 --- a/src/endstop.c +++ b/src/endstop.c @@ -7,7 +7,7 @@ #include // offsetof #include "basecmd.h" // alloc_oid #include "board/gpio.h" // struct gpio -#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" // stepper_stop @@ -73,11 +73,11 @@ DECL_COMMAND(command_end_stop_home, static void end_stop_report(uint8_t oid, struct end_stop *e) { - uint8_t flag = irq_save(); + irq_disable(); uint32_t position = stepper_get_position(e->stepper); uint8_t eflags = e->flags; e->flags &= ~ESF_REPORT; - irq_restore(flag); + irq_enable(); sendf("end_stop_state oid=%c homing=%c pin=%c pos=%i" , oid, !!(eflags & ESF_HOMING), gpio_in_read(e->pin) -- cgit v1.2.3-70-g09d2