mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 11:33: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:
@@ -235,7 +235,7 @@ private:
|
||||
|
||||
ringbuffer::RingBuffer *_reports;
|
||||
|
||||
struct gyro_scale _gyro_scale;
|
||||
struct gyro_calibration_s _gyro_scale;
|
||||
float _gyro_range_scale;
|
||||
float _gyro_range_rad_s;
|
||||
orb_advert_t _gyro_topic;
|
||||
@@ -704,12 +704,12 @@ L3GD20::ioctl(struct file *filp, int cmd, unsigned long arg)
|
||||
|
||||
case GYROIOCSSCALE:
|
||||
/* copy scale in */
|
||||
memcpy(&_gyro_scale, (struct gyro_scale *) arg, sizeof(_gyro_scale));
|
||||
memcpy(&_gyro_scale, (struct gyro_calibration_s *) arg, sizeof(_gyro_scale));
|
||||
return OK;
|
||||
|
||||
case GYROIOCGSCALE:
|
||||
/* copy scale out */
|
||||
memcpy((struct gyro_scale *) arg, &_gyro_scale, sizeof(_gyro_scale));
|
||||
memcpy((struct gyro_calibration_s *) arg, &_gyro_scale, sizeof(_gyro_scale));
|
||||
return OK;
|
||||
|
||||
case GYROIOCSRANGE:
|
||||
|
||||
Reference in New Issue
Block a user