summaryrefslogtreecommitdiff
path: root/src/lpc/ao_arch_funcs.h
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-06-15 01:20:49 -0700
committerKeith Packard <keithp@keithp.com>2013-06-15 01:21:45 -0700
commitbe9ee9ed2d041c4ab4e77ee2010fe3c7a1ca6597 (patch)
tree2ec07a0e0e03157589b51e6d5d67a2e01972af83 /src/lpc/ao_arch_funcs.h
parent7361371190bf3805b6d0414e61f697aca7c7cff1 (diff)
altos/lpc: Filter ADC inputs
They're amazingly noisy on EasyMini, so just filter them as the only thing we use them for is battery and pyro numbers. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/lpc/ao_arch_funcs.h')
-rw-r--r--src/lpc/ao_arch_funcs.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/lpc/ao_arch_funcs.h b/src/lpc/ao_arch_funcs.h
index 179b2f4d..1bbb14f5 100644
--- a/src/lpc/ao_arch_funcs.h
+++ b/src/lpc/ao_arch_funcs.h
@@ -61,12 +61,10 @@
#define analog_func(id) lpc_token_evaluator_2(LPC_IOCONF_FUNC_AD,id)
#define ao_enable_analog(port,bit,id) do { \
- uint32_t _mode; \
ao_enable_port(port); \
lpc_gpio.dir[port] &= ~(1 << bit); \
- _mode = ((analog_func(id) << LPC_IOCONF_FUNC) | \
- (0 << LPC_IOCONF_ADMODE)); \
- lpc_ioconf.analog_reg(port,bit) = _mode; \
+ lpc_ioconf.analog_reg(port,bit) = ((analog_func(id) << LPC_IOCONF_FUNC) | \
+ (0 << LPC_IOCONF_ADMODE)); \
} while (0)
#define ARM_PUSH32(stack, val) (*(--(stack)) = (val))