diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2013-09-12 09:51:06 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2013-09-12 09:51:06 +0200 |
commit | c92e3f3f4b3fb2a58c1407530dddb6824a6335b7 (patch) | |
tree | 947f3fe3c4f0c2e77e61d8bbc7807cee12940d75 | |
parent | 514d32e961e37f68443871dd93f4ce4c89c4aad9 (diff) | |
parent | 5e6d3604a377ab56bb0f40384fffb9370dbe0d74 (diff) | |
download | px4-firmware-c92e3f3f4b3fb2a58c1407530dddb6824a6335b7.tar.gz px4-firmware-c92e3f3f4b3fb2a58c1407530dddb6824a6335b7.tar.bz2 px4-firmware-c92e3f3f4b3fb2a58c1407530dddb6824a6335b7.zip |
Merge branch 'master' into fat-dma
-rw-r--r-- | src/drivers/ms5611/ms5611_spi.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/drivers/ms5611/ms5611_spi.cpp b/src/drivers/ms5611/ms5611_spi.cpp index f6c624340..21caed2ff 100644 --- a/src/drivers/ms5611/ms5611_spi.cpp +++ b/src/drivers/ms5611/ms5611_spi.cpp @@ -134,6 +134,7 @@ int MS5611_SPI::init() { int ret; + irqstate_t flags; ret = SPI::init(); if (ret != OK) { @@ -141,15 +142,23 @@ MS5611_SPI::init() goto out; } + /* disable interrupts, make this section atomic */ + flags = irqsave(); /* send reset command */ ret = _reset(); + /* re-enable interrupts */ + irqrestore(flags); if (ret != OK) { debug("reset failed"); goto out; } + /* disable interrupts, make this section atomic */ + flags = irqsave(); /* read PROM */ ret = _read_prom(); + /* re-enable interrupts */ + irqrestore(flags); if (ret != OK) { debug("prom readout failed"); goto out; |