summaryrefslogtreecommitdiff
path: root/src/cc1111/ao_arch_funcs.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/cc1111/ao_arch_funcs.h')
-rw-r--r--src/cc1111/ao_arch_funcs.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/cc1111/ao_arch_funcs.h b/src/cc1111/ao_arch_funcs.h
index 0a322961..0737e7ab 100644
--- a/src/cc1111/ao_arch_funcs.h
+++ b/src/cc1111/ao_arch_funcs.h
@@ -77,14 +77,14 @@ ao_spi_init(void);
SPI_CS_SEL &= ~mask; \
} while (0)
-#define cc1111_enable_output(port,dir,sel,mask,v) do { \
- port = port & ~(mask) | v; \
- dir |= mask; \
- sel &= ~mask; \
-} while (0)
+#define cc1111_enable_output(port,dir,sel,pin,bit,v) do { \
+ pin = v; \
+ dir |= (1 << bit); \
+ sel &= ~(1 << bit); \
+ } while (0)
#define disable_unreachable _Pragma("disable_warning 126")
#define token_paster(x,y) x ## y
#define token_evaluator(x,y) token_paster(x,y)
-#define ao_enable_output(port,pin,v) cc1111_enable_output(port,token_evaluator(port,DIR), token_evaluator(port,SEL), 1 << pin, 1 << v)
+#define ao_enable_output(port,bit,pin,v) cc1111_enable_output(port,token_evaluator(port,DIR), token_evaluator(port,SEL), pin, bit, v)