mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-20 03:13:44 +08:00
uavcan: allow board to override hw name
This commit is contained in:
committed by
Alexander Lerach
parent
a257f47822
commit
2ad00e40b0
@@ -36,6 +36,13 @@
|
||||
#include "boot_app_shared.h"
|
||||
#include "boot_alt_app_shared.h"
|
||||
|
||||
// Weak default: return the compile-time name from uavcan_board_identity.
|
||||
// Boards that resolve the name at runtime can provide a strong override.
|
||||
extern "C" __attribute__((weak)) const char *board_get_uavcan_hw_name(void)
|
||||
{
|
||||
return HW_UAVCAN_NAME;
|
||||
}
|
||||
|
||||
#include <drivers/drv_watchdog.h>
|
||||
#include <lib/geo/geo.h>
|
||||
#include <lib/version/version.h>
|
||||
@@ -351,7 +358,7 @@ void UavcanNode::cb_beginfirmware_update(const uavcan::ReceivedDataStructure<Uav
|
||||
|
||||
int UavcanNode::init(uavcan::NodeID node_id, UAVCAN_DRIVER::BusEvent &bus_events)
|
||||
{
|
||||
_node.setName(HW_UAVCAN_NAME);
|
||||
_node.setName(board_get_uavcan_hw_name());
|
||||
|
||||
// Was the node_id supplied by the bootloader?
|
||||
|
||||
|
||||
Reference in New Issue
Block a user