AP_UAVCAN: add can driver getter
This commit is contained in:
parent
80cb2e343c
commit
1dd14a8aed
@ -1347,4 +1347,12 @@ bool AP_UAVCAN::led_write(uint8_t led_index, uint8_t red, uint8_t green, uint8_t
|
||||
return true;
|
||||
}
|
||||
|
||||
AP_UAVCAN *AP_UAVCAN::get_uavcan(uint8_t iface)
|
||||
{
|
||||
if (iface >= MAX_NUMBER_OF_CAN_INTERFACES || !hal.can_mgr[iface]) {
|
||||
return nullptr;
|
||||
}
|
||||
return hal.can_mgr[iface]->get_UAVCAN();
|
||||
}
|
||||
|
||||
#endif // HAL_WITH_UAVCAN
|
||||
|
@ -54,6 +54,9 @@ public:
|
||||
|
||||
static const struct AP_Param::GroupInfo var_info[];
|
||||
|
||||
// Return uavcan from @iface or nullptr if it's not ready or doesn't exist
|
||||
static AP_UAVCAN *get_uavcan(uint8_t iface);
|
||||
|
||||
// this function will register the listening class on a first free channel or on the specified channel
|
||||
// if preferred_channel = 0 then free channel will be searched for
|
||||
// if preferred_channel > 0 then listener will be added to specific channel
|
||||
|
Loading…
Reference in New Issue
Block a user