summaryrefslogtreecommitdiff
path: root/src/drivers/ao_ms5607.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-10-25 11:25:42 -0700
committerKeith Packard <keithp@keithp.com>2012-10-25 11:25:42 -0700
commitf221c78e6237e0a118ebe85c25e433fe16a7735d (patch)
tree52e5e0dd555b3b0e5eef86e5f3d879304b4d9594 /src/drivers/ao_ms5607.c
parent963f7715be6c67056bbd8bbe898639adac64fc29 (diff)
altos: Switch drivers to ao_arch_block/release_interrupts
Stop using cli/sei, which are avr-specific Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/drivers/ao_ms5607.c')
-rw-r--r--src/drivers/ao_ms5607.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/drivers/ao_ms5607.c b/src/drivers/ao_ms5607.c
index ce0bcf4b..55bea563 100644
--- a/src/drivers/ao_ms5607.c
+++ b/src/drivers/ao_ms5607.c
@@ -130,7 +130,6 @@ static uint32_t
ao_ms5607_get_sample(uint8_t cmd) {
uint8_t reply[3];
uint8_t read;
- uint32_t loops;
ao_ms5607_done = 0;
@@ -142,15 +141,10 @@ ao_ms5607_get_sample(uint8_t cmd) {
#if AO_MS5607_PRIVATE_PINS
ao_spi_put(AO_MS5607_SPI_INDEX);
#endif
-// loops = 0;
- cli();
- while (!ao_ms5607_done) {
-// loops++;
+ ao_arch_block_interrupts();
+ while (!ao_ms5607_done)
ao_sleep((void *) &ao_ms5607_done);
- }
- sei();
-// if (loops > 1)
-// printf ("ms5607 loops %d\n", loops);
+ ao_arch_release_interrupts();
#if AO_MS5607_PRIVATE_PINS
stm_gpio_set(AO_MS5607_CS_PORT, AO_MS5607_CS_PIN, 1);
#else