mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-31 05:01:36 +08:00
I2C/SPI require device type in constructor
This commit is contained in:
@@ -54,9 +54,6 @@ RM3100::RM3100(device::Device *interface, enum Rotation rotation, I2CSPIBusOptio
|
||||
_measure_interval(0),
|
||||
_check_state_cnt(0)
|
||||
{
|
||||
_interface->set_device_type(DRV_MAG_DEVTYPE_RM3100);
|
||||
|
||||
_px4_mag.set_device_type(DRV_MAG_DEVTYPE_RM3100);
|
||||
_px4_mag.set_external(_interface->external());
|
||||
|
||||
_px4_mag.set_scale(1.f / (RM3100_SENSITIVITY * UTESLA_TO_GAUSS));
|
||||
|
||||
@@ -80,9 +80,8 @@ RM3100_I2C_interface(int bus, int bus_frequency)
|
||||
}
|
||||
|
||||
RM3100_I2C::RM3100_I2C(int bus, int bus_frequency) :
|
||||
I2C("RM300_I2C", nullptr, bus, RM3100_ADDRESS, bus_frequency)
|
||||
I2C(DRV_MAG_DEVTYPE_RM3100, MODULE_NAME, bus, RM3100_ADDRESS, bus_frequency)
|
||||
{
|
||||
_device_id.devid_s.devtype = DRV_MAG_DEVTYPE_RM3100;
|
||||
}
|
||||
|
||||
int RM3100_I2C::probe()
|
||||
|
||||
@@ -80,9 +80,8 @@ RM3100_SPI_interface(int bus, uint32_t devid, int bus_frequency, spi_mode_e spi_
|
||||
}
|
||||
|
||||
RM3100_SPI::RM3100_SPI(int bus, uint32_t devid, int bus_frequency, spi_mode_e spi_mode) :
|
||||
SPI("RM3100_SPI", nullptr, bus, devid, spi_mode, bus_frequency)
|
||||
SPI(DRV_MAG_DEVTYPE_RM3100, MODULE_NAME, bus, devid, spi_mode, bus_frequency)
|
||||
{
|
||||
_device_id.devid_s.devtype = DRV_MAG_DEVTYPE_RM3100;
|
||||
}
|
||||
|
||||
int RM3100_SPI::init()
|
||||
|
||||
Reference in New Issue
Block a user