mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 12:53:34 +08:00
ms5611: added -X option for external SPI bus
This commit is contained in:
committed by
Lorenz Meier
parent
541dc1825c
commit
ab90fe7832
@@ -62,7 +62,7 @@
|
||||
|
||||
#ifdef PX4_SPIDEV_BARO
|
||||
|
||||
device::Device *MS5611_spi_interface(ms5611::prom_u &prom_buf);
|
||||
device::Device *MS5611_spi_interface(ms5611::prom_u &prom_buf, bool external_bus);
|
||||
|
||||
class MS5611_SPI : public device::SPI
|
||||
{
|
||||
@@ -115,9 +115,13 @@ private:
|
||||
};
|
||||
|
||||
device::Device *
|
||||
MS5611_spi_interface(ms5611::prom_u &prom_buf)
|
||||
MS5611_spi_interface(ms5611::prom_u &prom_buf, bool external_bus)
|
||||
{
|
||||
return new MS5611_SPI(PX4_SPI_BUS_SENSORS, (spi_dev_e)PX4_SPIDEV_BARO, prom_buf);
|
||||
if (external_bus) {
|
||||
return new MS5611_SPI(PX4_SPI_BUS_EXT, (spi_dev_e)PX4_SPIDEV_EXT_BARO, prom_buf);
|
||||
} else {
|
||||
return new MS5611_SPI(PX4_SPI_BUS_SENSORS, (spi_dev_e)PX4_SPIDEV_BARO, prom_buf);
|
||||
}
|
||||
}
|
||||
|
||||
MS5611_SPI::MS5611_SPI(int bus, spi_dev_e device, ms5611::prom_u &prom_buf) :
|
||||
|
||||
Reference in New Issue
Block a user