mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-08 18:52:46 +08:00
uORB: Ensure correct instance initialization, port complete mag API to new interface
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user