AP_Compass: added SITL device IDs

This commit is contained in:
Andrew Tridgell 2018-06-27 13:31:10 +10:00
parent 464dc9102f
commit 823c4523b3
2 changed files with 4 additions and 2 deletions

View File

@ -61,8 +61,9 @@ public:
DEVTYPE_IST8310 = 0x0A,
DEVTYPE_ICM20948 = 0x0B,
DEVTYPE_MMC3416 = 0x0C,
DEVTYPE_QMC5883L = 0x0D,
DEVTYPE_MAG3110 = 0x0E,
DEVTYPE_QMC5883L = 0x0D,
DEVTYPE_MAG3110 = 0x0E,
DEVTYPE_SITL = 0x0F,
};

View File

@ -14,6 +14,7 @@ AP_Compass_SITL::AP_Compass_SITL(Compass &compass):
_compass._setup_earth_field();
for (uint8_t i=0; i<SITL_NUM_COMPASSES; i++) {
_compass_instance[i] = register_compass();
set_dev_id(_compass_instance[i], AP_HAL::Device::make_bus_id(AP_HAL::Device::BUS_TYPE_SITL, i, 0, DEVTYPE_SITL));
}
hal.scheduler->register_timer_process(FUNCTOR_BIND(this, &AP_Compass_SITL::_timer, void));
}