mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-19 13:33:33 +08:00
board_name.c: remove the file and HW_ARCH macro, use px4_board_name() instead
boards define BOARD_NAME, so board_name() is not necessary. HW_ARCH was just a wrapper around board_name(). This patch simplifies to having only one common method px4_board_name().
This commit is contained in:
@@ -183,14 +183,14 @@ int UavcanNode::getHardwareVersion(uavcan::protocol::HardwareVersion &hwver)
|
||||
int rv = -1;
|
||||
|
||||
if (UavcanNode::instance()) {
|
||||
if (!std::strncmp(HW_ARCH, "PX4FMU_V1", 9)) {
|
||||
if (!std::strncmp(px4_board_name(), "PX4FMU_V1", 9)) {
|
||||
hwver.major = 1;
|
||||
|
||||
} else if (!std::strncmp(HW_ARCH, "PX4FMU_V2", 9)) {
|
||||
} else if (!std::strncmp(px4_board_name(), "PX4FMU_V2", 9)) {
|
||||
hwver.major = 2;
|
||||
|
||||
} else {
|
||||
; // All other values of HW_ARCH resolve to zero
|
||||
; // All other values of px4_board_name() resolve to zero
|
||||
}
|
||||
|
||||
uint8_t udid[12] = {}; // Someone seems to love magic numbers
|
||||
|
||||
Reference in New Issue
Block a user