MS5611: Deal with missing external bus

This commit is contained in:
Lorenz Meier 2014-07-08 13:50:24 +02:00
parent 369c7d277f
commit a42ec7df1b
1 changed files with 4 additions and 0 deletions

View File

@ -118,7 +118,11 @@ device::Device *
MS5611_spi_interface(ms5611::prom_u &prom_buf, bool external_bus) MS5611_spi_interface(ms5611::prom_u &prom_buf, bool external_bus)
{ {
if (external_bus) { if (external_bus) {
#ifdef PX4_SPI_BUS_EXT
return new MS5611_SPI(PX4_SPI_BUS_EXT, (spi_dev_e)PX4_SPIDEV_EXT_BARO, prom_buf); return new MS5611_SPI(PX4_SPI_BUS_EXT, (spi_dev_e)PX4_SPIDEV_EXT_BARO, prom_buf);
#else
return nullptr;
#endif
} else { } else {
return new MS5611_SPI(PX4_SPI_BUS_SENSORS, (spi_dev_e)PX4_SPIDEV_BARO, prom_buf); return new MS5611_SPI(PX4_SPI_BUS_SENSORS, (spi_dev_e)PX4_SPIDEV_BARO, prom_buf);
} }