mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 00:43:33 +08:00
param: automatically update calibration ID params on import
This avoids the need for recalibration, and also cleans up other driver ID's (merge separate accel/gyro). The SPI address was previously set to a board-specific (arbitrary) value, and is now set to 0. This will allow extending for multiple sensors of the same type on the same bus.
This commit is contained in:
@@ -67,7 +67,9 @@ SPI::SPI(const char *name, const char *devname, int bus, uint32_t device, enum s
|
||||
// fill in _device_id fields for a SPI device
|
||||
_device_id.devid_s.bus_type = DeviceBusType_SPI;
|
||||
_device_id.devid_s.bus = bus;
|
||||
_device_id.devid_s.address = (uint8_t)device;
|
||||
// Use the 2. LSB byte as SPI address. This is currently 0, but will allow to extend
|
||||
// for multiple instances of the same device on a bus, should that ever be required.
|
||||
_device_id.devid_s.address = (uint8_t)(device >> 8);
|
||||
// devtype needs to be filled in by the driver
|
||||
_device_id.devid_s.devtype = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user