mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-02 05:04:08 +08:00
uavcan: bug fix sensor bridge init failure
Fixes case where a UAVCAN SensorBridge has callback channels available, but NuttX / uORB does not have an additional driver / topic instance available.
This commit is contained in:
parent
531efc2d53
commit
46aab317d5
@ -185,8 +185,13 @@ uavcan_bridge::Channel *UavcanCDevSensorBridgeBase::get_channel_for_node(int nod
|
||||
int ret = init_driver(channel);
|
||||
|
||||
if (ret != PX4_OK) {
|
||||
// Driver initialization failed - probably out of channels. Return nullptr so
|
||||
// the callback exits gracefully, and clear the assigned node_id for the channel
|
||||
// so future callbacks exit immediately.
|
||||
DEVICE_LOG("INIT ERROR node %d errno %d", channel->node_id, ret);
|
||||
return channel;
|
||||
channel->node_id = -1;
|
||||
_out_of_channels = true;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
DEVICE_LOG("channel %d class instance %d ok", channel->node_id, channel->class_instance);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user