diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2015-01-25 17:50:57 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2015-01-29 16:33:52 +0100 |
commit | 50a58db7e605c61bb50cfb154cbc43bf9c4c67ae (patch) | |
tree | fcd1ef191b0a2b58eb1ccbd92d488339c1d70d23 /src/modules | |
parent | 4f9a6273cb28e50fdabdf1f60c39da6fe0b4fcd6 (diff) | |
download | px4-firmware-50a58db7e605c61bb50cfb154cbc43bf9c4c67ae.tar.gz px4-firmware-50a58db7e605c61bb50cfb154cbc43bf9c4c67ae.tar.bz2 px4-firmware-50a58db7e605c61bb50cfb154cbc43bf9c4c67ae.zip |
uORB: Ensure correct instance initialization, port complete mag API to new interface
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/uORB/objects_common.cpp | 4 | ||||
-rw-r--r-- | src/modules/uORB/uORB.cpp | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/modules/uORB/objects_common.cpp b/src/modules/uORB/objects_common.cpp index 20a9bcc43..a8305ebea 100644 --- a/src/modules/uORB/objects_common.cpp +++ b/src/modules/uORB/objects_common.cpp @@ -46,9 +46,7 @@ #include <drivers/drv_orb_dev.h> #include <drivers/drv_mag.h> -ORB_DEFINE(sensor_mag0, struct mag_report); -ORB_DEFINE(sensor_mag1, struct mag_report); -ORB_DEFINE(sensor_mag2, struct mag_report); +ORB_DEFINE(sensor_mag, struct mag_report); #include <drivers/drv_accel.h> ORB_DEFINE(sensor_accel0, struct accel_report); diff --git a/src/modules/uORB/uORB.cpp b/src/modules/uORB/uORB.cpp index b3a9bedb1..6f021459c 100644 --- a/src/modules/uORB/uORB.cpp +++ b/src/modules/uORB/uORB.cpp @@ -592,6 +592,11 @@ ORBDevMaster::ioctl(struct file *filp, int cmd, unsigned long arg) char nodepath[orb_maxpath]; ORBDevNode *node; + /* set instance to zero - we could allow selective multi-pubs later based on value */ + if (adv->instance != nullptr) { + *(adv->instance) = 0; + } + /* construct a path to the node - this also checks the node name */ ret = node_mkpath(nodepath, _flavor, meta, adv->instance); |