mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
UAVCAN: Proper CDev initialization from sensor bridges
This commit is contained in:
parent
4e0d7c6b0e
commit
ce73be514e
@ -53,7 +53,12 @@ _sub_air_data(node)
|
||||
|
||||
int UavcanBarometerBridge::init()
|
||||
{
|
||||
int res = _sub_air_data.start(AirDataCbBinder(this, &UavcanBarometerBridge::air_data_sub_cb));
|
||||
int res = device::CDev::init();
|
||||
if (res < 0) {
|
||||
return res;
|
||||
}
|
||||
|
||||
res = _sub_air_data.start(AirDataCbBinder(this, &UavcanBarometerBridge::air_data_sub_cb));
|
||||
if (res < 0) {
|
||||
log("failed to start uavcan sub: %d", res);
|
||||
return res;
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user