mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-28 19:32:36 +08:00
feat(boards/px4_fmu-v6c): add RM3100 fallback for internal compass (#27299)
This commit is contained in:
@@ -25,7 +25,11 @@ fi
|
||||
ms5611 -X -b 4 -a 0x77 start
|
||||
|
||||
# Internal compass on IMU I2C4 (The same bus is also exposed externally, and therefore marked as external)
|
||||
ist8310 -X -b 4 -a 0xc start
|
||||
# Standard FMUv6C uses IST8310; the variant board falls back to RM3100.
|
||||
if ! ist8310 -X -b 4 -a 0xc -q start
|
||||
then
|
||||
rm3100 -X -b 4 -R 8 start
|
||||
fi
|
||||
|
||||
# External compass on GPS/I2C1 (the 3rd external bus): standard Holybro Pixhawk 4 or CUAV V5 GPS/compass puck (with lights, safety button, and buzzer)
|
||||
ist8310 -X -b 1 -R 10 start
|
||||
|
||||
@@ -71,6 +71,17 @@ bool px4_i2c_device_external(const uint32_t device_id)
|
||||
if (device_id_mag.devid == device_id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// device_id: RM3100 on I2C4 address 0x20
|
||||
device::Device::DeviceId device_id_rm3100{};
|
||||
device_id_rm3100.devid_s.bus_type = device::Device::DeviceBusType_I2C;
|
||||
device_id_rm3100.devid_s.bus = 4;
|
||||
device_id_rm3100.devid_s.address = 0x20;
|
||||
device_id_rm3100.devid_s.devtype = DRV_MAG_DEVTYPE_RM3100;
|
||||
|
||||
if (device_id_rm3100.devid == device_id) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
device::Device::DeviceId dev_id{};
|
||||
|
||||
Reference in New Issue
Block a user