mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-06 06:21:36 +08:00
I2C/SPI require device type in constructor
This commit is contained in:
@@ -65,9 +65,6 @@ LIS3MDL::LIS3MDL(device::Device *interface, enum Rotation rotation, I2CSPIBusOpt
|
||||
_temperature_counter(0),
|
||||
_temperature_error_count(0)
|
||||
{
|
||||
_interface->set_device_type(DRV_MAG_DEVTYPE_IST8310);
|
||||
|
||||
_px4_mag.set_device_type(DRV_MAG_DEVTYPE_IST8310);
|
||||
_px4_mag.set_external(_interface->external());
|
||||
}
|
||||
|
||||
|
||||
@@ -81,9 +81,8 @@ LIS3MDL_I2C_interface(int bus, int bus_frequency)
|
||||
}
|
||||
|
||||
LIS3MDL_I2C::LIS3MDL_I2C(int bus, int bus_frequency) :
|
||||
I2C("LIS3MDL_I2C", nullptr, bus, LIS3MDLL_ADDRESS, bus_frequency)
|
||||
I2C(DRV_MAG_DEVTYPE_LIS3MDL, MODULE_NAME, bus, LIS3MDLL_ADDRESS, bus_frequency)
|
||||
{
|
||||
_device_id.devid_s.devtype = DRV_MAG_DEVTYPE_LIS3MDL;
|
||||
}
|
||||
|
||||
int LIS3MDL_I2C::probe()
|
||||
|
||||
@@ -81,9 +81,8 @@ LIS3MDL_SPI_interface(int bus, uint32_t devid, int bus_frequency, spi_mode_e spi
|
||||
}
|
||||
|
||||
LIS3MDL_SPI::LIS3MDL_SPI(int bus, uint32_t devid, int bus_frequency, spi_mode_e spi_mode) :
|
||||
SPI("LIS3MDL_SPI", nullptr, bus, devid, spi_mode, bus_frequency)
|
||||
SPI(DRV_MAG_DEVTYPE_LIS3MDL, MODULE_NAME, bus, devid, spi_mode, bus_frequency)
|
||||
{
|
||||
_device_id.devid_s.devtype = DRV_MAG_DEVTYPE_LIS3MDL;
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
Reference in New Issue
Block a user