aboutsummaryrefslogtreecommitdiff
path: root/src/modules/uavcan/sensors/mag.cpp
diff options
context:
space:
mode:
authorPavel Kirienko <pavel.kirienko@gmail.com>2014-08-23 23:30:49 +0400
committerPavel Kirienko <pavel.kirienko@gmail.com>2014-08-23 23:30:49 +0400
commitce73be514e0add0356c120c19e43f6818af236ad (patch)
tree9aa33a3fd728aeaaf090e523eb03cc3b736a87e9 /src/modules/uavcan/sensors/mag.cpp
parent4e0d7c6b0e52d3eecba65f4415d4c7372dfd8a49 (diff)
downloadpx4-firmware-ce73be514e0add0356c120c19e43f6818af236ad.tar.gz
px4-firmware-ce73be514e0add0356c120c19e43f6818af236ad.tar.bz2
px4-firmware-ce73be514e0add0356c120c19e43f6818af236ad.zip
UAVCAN: Proper CDev initialization from sensor bridges
Diffstat (limited to 'src/modules/uavcan/sensors/mag.cpp')
-rw-r--r--src/modules/uavcan/sensors/mag.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/modules/uavcan/sensors/mag.cpp b/src/modules/uavcan/sensors/mag.cpp
index aaa3a4463..8e6a9a22f 100644
--- a/src/modules/uavcan/sensors/mag.cpp
+++ b/src/modules/uavcan/sensors/mag.cpp
@@ -56,7 +56,12 @@ _sub_mag(node)
int UavcanMagnetometerBridge::init()
{
- int res = _sub_mag.start(MagCbBinder(this, &UavcanMagnetometerBridge::mag_sub_cb));
+ int res = device::CDev::init();
+ if (res < 0) {
+ return res;
+ }
+
+ res = _sub_mag.start(MagCbBinder(this, &UavcanMagnetometerBridge::mag_sub_cb));
if (res < 0) {
log("failed to start uavcan sub: %d", res);
return res;