summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-05-19 19:51:32 -0700
committerKeith Packard <keithp@keithp.com>2013-05-19 19:51:32 -0700
commitb7ab41e4dc92dcd382f4c05459088d8df8b70075 (patch)
tree80beeccdfdd4873ee76e6da5a096a39d5a4b6ca0 /src
parent49f9cdda5f1812687b82915acc78a9d9136255bf (diff)
altos/attiny: Fix ao_spi_get_bit/ao_spi_put_bit macros
These were never written, so just use ao_spi_get/put_mask. A precursor to changing how the MS5607 drives the SPI bus Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src')
-rw-r--r--src/attiny/ao_arch_funcs.h11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/attiny/ao_arch_funcs.h b/src/attiny/ao_arch_funcs.h
index 8c9d1ae6..76dc7820 100644
--- a/src/attiny/ao_arch_funcs.h
+++ b/src/attiny/ao_arch_funcs.h
@@ -20,21 +20,16 @@
*/
#define ao_spi_get_mask(reg,mask,bus,speed) do { \
- (reg) &= ~(mask); \
+ (reg) &= ~(mask); \
} while (0)
#define ao_spi_put_mask(reg,mask,bus) do { \
(reg) |= (mask); \
} while (0)
-#define ao_spi_get_bit(reg,bit,pin,bus,speed) do { \
- (pin) = 0; \
- } while (0)
-
-#define ao_spi_put_bit(reg,bit,pin,bus) do { \
- (pin) = 1; \
- } while (0)
+#define ao_spi_get_bit(reg,bit,pin,bus,speed) ao_spi_get_mask(reg,(1<<(bit)),bus,speed)
+#define ao_spi_put_bit(reg,bit,pin,bus) ao_spi_put_mask(reg,(1<<(bit)),bus)
#define ao_gpio_token_paster(x,y) x ## y
#define ao_gpio_token_evaluator(x,y) ao_gpio_token_paster(x,y)