From 36a787bd91a50f0b3b16aac93b536f2a636d942d Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Thu, 20 Aug 2015 10:19:19 +0200 Subject: [PATCH] Mag: move to generated uORB topics --- msg/sensor_mag.msg | 12 ++++++++++++ src/drivers/drv_mag.h | 28 ++-------------------------- 2 files changed, 14 insertions(+), 26 deletions(-) create mode 100644 msg/sensor_mag.msg diff --git a/msg/sensor_mag.msg b/msg/sensor_mag.msg new file mode 100644 index 0000000000..3ac97227ea --- /dev/null +++ b/msg/sensor_mag.msg @@ -0,0 +1,12 @@ +uint64 timestamp +uint64 error_count +float32 x +float32 y +float32 z +float32 range_ga +float32 scaling +float32 temperature + +int16 x_raw +int16 y_raw +int16 z_raw diff --git a/src/drivers/drv_mag.h b/src/drivers/drv_mag.h index e2f8493e38..3abe84c883 100644 --- a/src/drivers/drv_mag.h +++ b/src/drivers/drv_mag.h @@ -49,26 +49,8 @@ #define MAG1_DEVICE_PATH "/dev/mag1" #define MAG2_DEVICE_PATH "/dev/mag2" -/** - * mag report structure. Reads from the device must be in multiples of this - * structure. - * - * Output values are in gauss. - */ -struct mag_report { - uint64_t timestamp; - uint64_t error_count; - float x; - float y; - float z; - float range_ga; - float scaling; - float temperature; - - int16_t x_raw; - int16_t y_raw; - int16_t z_raw; -}; +#include +#define mag_report sensor_mag_s /** mag scaling factors; Vout = (Vin * Vscale) + Voffset */ struct mag_scale { @@ -80,12 +62,6 @@ struct mag_scale { float z_scale; }; -/* - * ObjDev tag for raw magnetometer data. - */ -ORB_DECLARE(sensor_mag); - - /* * ioctl() definitions */