fix param_translation: set address to 0 only on NuttX

On Linux it can be non-zero.
This commit is contained in:
Beat Küng 2020-04-14 11:11:11 +02:00 committed by Daniel Agar
parent 338dd45022
commit 0c5fbf5954

View File

@ -101,10 +101,14 @@ bool param_modify_on_import(bson_node_t node)
device_id.devid = (uint32_t) * ivalue;
// SPI board config translation
#ifdef __PX4_NUTTX // only on NuttX the address is 0
if (device_id.devid_s.bus_type == device::Device::DeviceBusType_SPI) {
device_id.devid_s.address = 0;
}
#endif
// deprecated ACC -> IMU translations
if (device_id.devid_s.devtype == DRV_ACC_DEVTYPE_MPU6000_LEGACY) {
device_id.devid_s.devtype = DRV_IMU_DEVTYPE_MPU6000;