diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2016-06-08 20:51:00 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2016-06-13 23:18:59 -0400 |
commit | 9dd101c26fff95e596039d6168d4ad25e080071c (patch) | |
tree | de4878a531f087d29edb0a164136bacb7504474a /src/gpiocmds.c | |
parent | 4fcf5a31f5c6d84749b3ae85be9482161fd33815 (diff) | |
download | kutter-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/gpiocmds.c')
-rw-r--r-- | src/gpiocmds.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gpiocmds.c b/src/gpiocmds.c index 70608a6f..864d6526 100644 --- a/src/gpiocmds.c +++ b/src/gpiocmds.c @@ -6,7 +6,7 @@ #include "basecmd.h" // alloc_oid #include "board/gpio.h" // struct gpio_out -#include "board/irq.h" // irq_save +#include "board/irq.h" // irq_disable #include "command.h" // DECL_COMMAND #include "sched.h" // sched_timer @@ -188,7 +188,7 @@ command_schedule_soft_pwm_out(uint32_t *args) if (s->max_duration) next_flags |= SPF_NEXT_CHECK_END; } - uint8_t flag = irq_save(); + irq_disable(); if (s->flags & SPF_CHECK_END && sched_is_before(s->end_time, time)) shutdown("next soft pwm extends existing pwm"); s->end_time = time; @@ -204,7 +204,7 @@ command_schedule_soft_pwm_out(uint32_t *args) s->timer.func = soft_pwm_load_event; sched_timer(&s->timer); } - irq_restore(flag); + irq_enable(); } DECL_COMMAND(command_schedule_soft_pwm_out, "schedule_soft_pwm_out oid=%c clock=%u value=%c"); |