mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-07 09:13:32 +08:00
drivers: use driver class instance as surrogate sensor ID for gyro and accelerometer
This commit is contained in:
committed by
Lorenz Meier
parent
60c12aaa36
commit
e84a189380
@@ -1288,8 +1288,8 @@ BMI160::measure()
|
||||
arb.temperature_raw = report.temp;
|
||||
arb.temperature = _last_temperature;
|
||||
|
||||
/* TODO return unique hardware ID */
|
||||
arb.device_id = 0;
|
||||
/* Return class instance as a surrogate device ID */
|
||||
arb.device_id = _accel_class_instance;
|
||||
|
||||
grb.x_raw = report.gyro_x;
|
||||
grb.y_raw = report.gyro_y;
|
||||
@@ -1324,8 +1324,8 @@ BMI160::measure()
|
||||
grb.temperature_raw = report.temp;
|
||||
grb.temperature = _last_temperature;
|
||||
|
||||
/* TODO return unique hardware ID */
|
||||
grb.device_id = 0;
|
||||
/* Use class instance as a surrogate hardware ID */
|
||||
grb.device_id = _gyro->_gyro_class_instance;
|
||||
|
||||
_accel_reports->force(&arb);
|
||||
_gyro_reports->force(&grb);
|
||||
|
||||
@@ -1075,8 +1075,8 @@ L3GD20::measure()
|
||||
report.scaling = _gyro_range_scale;
|
||||
report.range_rad_s = _gyro_range_rad_s;
|
||||
|
||||
/* TODO return unique hardware ID */
|
||||
report.device_id = 0;
|
||||
/* Return class instance as a surrogate device ID */
|
||||
report.device_id = _class_instance;
|
||||
|
||||
_reports->force(&report);
|
||||
|
||||
|
||||
@@ -1642,8 +1642,8 @@ LSM303D::measure()
|
||||
accel_report.scaling = _accel_range_scale;
|
||||
accel_report.range_m_s2 = _accel_range_m_s2;
|
||||
|
||||
/* TODO return unique hardware ID */
|
||||
accel_report.device_id = 0;
|
||||
/* Return class instance as a surrogate device ID */
|
||||
accel_report.device_id = _accel_class_instance;
|
||||
|
||||
_accel_reports->force(&accel_report);
|
||||
|
||||
|
||||
@@ -2030,8 +2030,8 @@ MPU6000::measure()
|
||||
arb.temperature_raw = report.temp;
|
||||
arb.temperature = _last_temperature;
|
||||
|
||||
/* TODO return unique hardware ID */
|
||||
arb.device_id = 0;
|
||||
/* Return class instance as a surrogate device ID */
|
||||
arb.device_id = _accel_class_instance;
|
||||
|
||||
grb.x_raw = report.gyro_x;
|
||||
grb.y_raw = report.gyro_y;
|
||||
@@ -2066,8 +2066,8 @@ MPU6000::measure()
|
||||
grb.temperature_raw = report.temp;
|
||||
grb.temperature = _last_temperature;
|
||||
|
||||
/* TODO return unique hardware ID */
|
||||
grb.device_id = 0;
|
||||
/* Return class instance as a surrogate device ID */
|
||||
grb.device_id = _gyro->_gyro_class_instance;
|
||||
|
||||
_accel_reports->force(&arb);
|
||||
_gyro_reports->force(&grb);
|
||||
|
||||
@@ -1833,8 +1833,8 @@ MPU6500::measure()
|
||||
arb.temperature_raw = report.temp;
|
||||
arb.temperature = _last_temperature;
|
||||
|
||||
/* TODO return unique hardware ID */
|
||||
arb.device_id = 0;
|
||||
/* Return class instance as a surrogate device ID */
|
||||
arb.device_id = _accel_class_instance;
|
||||
|
||||
grb.x_raw = report.gyro_x;
|
||||
grb.y_raw = report.gyro_y;
|
||||
@@ -1869,7 +1869,8 @@ MPU6500::measure()
|
||||
grb.temperature_raw = report.temp;
|
||||
grb.temperature = _last_temperature;
|
||||
|
||||
/* TODO return unique hardware ID */
|
||||
/* Use class instance as a surrogate hardware ID */
|
||||
grb.device_id = _gyro->_gyro_class_instance;
|
||||
grb.device_id = 0;
|
||||
|
||||
_accel_reports->force(&arb);
|
||||
|
||||
@@ -1424,8 +1424,8 @@ MPU9250::measure()
|
||||
arb.temperature_raw = report.temp;
|
||||
arb.temperature = _last_temperature;
|
||||
|
||||
/* TODO return unique hardware ID */
|
||||
arb.device_id = 0;
|
||||
/* Return class instance as a surrogate device ID */
|
||||
arb.device_id = _accel_class_instance;
|
||||
|
||||
grb.x_raw = report.gyro_x;
|
||||
grb.y_raw = report.gyro_y;
|
||||
@@ -1460,8 +1460,8 @@ MPU9250::measure()
|
||||
grb.temperature_raw = report.temp;
|
||||
grb.temperature = _last_temperature;
|
||||
|
||||
/* TODO return unique hardware ID */
|
||||
grb.device_id = 0;
|
||||
/* Use class instance as a surrogate hardware ID */
|
||||
grb.device_id = _gyro->_gyro_class_instance;
|
||||
|
||||
_accel_reports->force(&arb);
|
||||
_gyro_reports->force(&grb);
|
||||
|
||||
Reference in New Issue
Block a user