mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-25 07:23:34 +08:00
drivers: re-use calibration topic
E.g. instead of defining a gyro_scale struct in drv_gyro.h, use the gyro_calibration message.
This commit is contained in:
@@ -149,7 +149,7 @@ private:
|
||||
|
||||
RingBuffer *_reports;
|
||||
|
||||
struct accel_scale _accel_scale;
|
||||
struct accel_calibration_s _accel_scale;
|
||||
float _accel_range_scale;
|
||||
float _accel_range_m_s2;
|
||||
orb_advert_t _accel_topic;
|
||||
@@ -496,12 +496,12 @@ BMA180::ioctl(struct file *filp, int cmd, unsigned long arg)
|
||||
|
||||
case ACCELIOCSSCALE:
|
||||
/* copy scale in */
|
||||
memcpy(&_accel_scale, (struct accel_scale *) arg, sizeof(_accel_scale));
|
||||
memcpy(&_accel_scale, (struct accel_calibration_s *) arg, sizeof(_accel_scale));
|
||||
return OK;
|
||||
|
||||
case ACCELIOCGSCALE:
|
||||
/* copy scale out */
|
||||
memcpy((struct accel_scale *) arg, &_accel_scale, sizeof(_accel_scale));
|
||||
memcpy((struct accel_calibration_s *) arg, &_accel_scale, sizeof(_accel_scale));
|
||||
return OK;
|
||||
|
||||
case ACCELIOCSRANGE:
|
||||
|
||||
Reference in New Issue
Block a user