forked from Archive/PX4-Autopilot
Made MS5611 startup exclusive as well
This commit is contained in:
parent
3a326cb467
commit
5e6d3604a3
|
@ -134,6 +134,7 @@ int
|
||||||
MS5611_SPI::init()
|
MS5611_SPI::init()
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
irqstate_t flags;
|
||||||
|
|
||||||
ret = SPI::init();
|
ret = SPI::init();
|
||||||
if (ret != OK) {
|
if (ret != OK) {
|
||||||
|
@ -141,15 +142,23 @@ MS5611_SPI::init()
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* disable interrupts, make this section atomic */
|
||||||
|
flags = irqsave();
|
||||||
/* send reset command */
|
/* send reset command */
|
||||||
ret = _reset();
|
ret = _reset();
|
||||||
|
/* re-enable interrupts */
|
||||||
|
irqrestore(flags);
|
||||||
if (ret != OK) {
|
if (ret != OK) {
|
||||||
debug("reset failed");
|
debug("reset failed");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* disable interrupts, make this section atomic */
|
||||||
|
flags = irqsave();
|
||||||
/* read PROM */
|
/* read PROM */
|
||||||
ret = _read_prom();
|
ret = _read_prom();
|
||||||
|
/* re-enable interrupts */
|
||||||
|
irqrestore(flags);
|
||||||
if (ret != OK) {
|
if (ret != OK) {
|
||||||
debug("prom readout failed");
|
debug("prom readout failed");
|
||||||
goto out;
|
goto out;
|
||||||
|
|
Loading…
Reference in New Issue