aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/ms5611/ms5611_i2c.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/ms5611/ms5611_i2c.cpp')
-rw-r--r--src/drivers/ms5611/ms5611_i2c.cpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/drivers/ms5611/ms5611_i2c.cpp b/src/drivers/ms5611/ms5611_i2c.cpp
index 87d9b94a6..ca651409f 100644
--- a/src/drivers/ms5611/ms5611_i2c.cpp
+++ b/src/drivers/ms5611/ms5611_i2c.cpp
@@ -56,14 +56,6 @@
#include "board_config.h"
-#ifdef PX4_I2C_OBDEV_MS5611
-
-#ifndef PX4_I2C_BUS_ONBOARD
- #define MS5611_BUS 1
-#else
- #define MS5611_BUS PX4_I2C_BUS_ONBOARD
-#endif
-
#define MS5611_ADDRESS_1 0x76 /* address select pins pulled high (PX4FMU series v1.6+) */
#define MS5611_ADDRESS_2 0x77 /* address select pins pulled low (PX4FMU prototypes) */
@@ -74,7 +66,7 @@ device::Device *MS5611_i2c_interface(ms5611::prom_u &prom_buf);
class MS5611_I2C : public device::I2C
{
public:
- MS5611_I2C(int bus, ms5611::prom_u &prom_buf);
+ MS5611_I2C(uint8_t bus, ms5611::prom_u &prom_buf);
virtual ~MS5611_I2C();
virtual int init();
@@ -113,12 +105,12 @@ private:
};
device::Device *
-MS5611_i2c_interface(ms5611::prom_u &prom_buf)
+MS5611_i2c_interface(ms5611::prom_u &prom_buf, uint8_t busnum)
{
- return new MS5611_I2C(MS5611_BUS, prom_buf);
+ return new MS5611_I2C(busnum, prom_buf);
}
-MS5611_I2C::MS5611_I2C(int bus, ms5611::prom_u &prom) :
+MS5611_I2C::MS5611_I2C(uint8_t bus, ms5611::prom_u &prom) :
I2C("MS5611_I2C", nullptr, bus, 0, 400000),
_prom(prom)
{
@@ -274,5 +266,3 @@ MS5611_I2C::_read_prom()
/* calculate CRC and return success/failure accordingly */
return ms5611::crc4(&_prom.c[0]) ? OK : -EIO;
}
-
-#endif /* PX4_I2C_OBDEV_MS5611 */