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:
Julian Oes
2016-03-24 13:08:30 +01:00
parent 98e407696e
commit b9cc0b74e2
16 changed files with 343 additions and 129 deletions
+3 -3
View File
@@ -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: