uavcan: allow board to override hw name

This commit is contained in:
alexcekay
2026-04-15 14:04:01 +02:00
committed by Alexander Lerach
parent a257f47822
commit 2ad00e40b0
+8 -1
View File
@@ -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?