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/adccmds.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/adccmds.c') diff --git a/src/adccmds.c b/src/adccmds.c index 2ae7f43c..9c70ab88 100644 --- a/src/adccmds.c +++ b/src/adccmds.c @@ -6,7 +6,7 @@ #include "basecmd.h" // alloc_oid #include "board/gpio.h" // struct gpio_adc -#include "board/irq.h" // irq_save +#include "board/irq.h" // irq_disable #include "command.h" // DECL_COMMAND #include "sched.h" // DECL_TASK @@ -90,15 +90,15 @@ analog_in_task(void) foreach_oid(oid, a, command_config_analog_in) { if (a->state != a->sample_count) continue; - uint8_t flag = irq_save(); + irq_disable(); if (a->state != a->sample_count) { - irq_restore(flag); + irq_enable(); continue; } uint16_t value = a->value; uint32_t next_begin_time = a->next_begin_time; a->state++; - irq_restore(flag); + irq_enable(); sendf("analog_in_state oid=%c next_clock=%u value=%hu" , oid, next_begin_time, value); } -- cgit v1.2.3-70-g09d2