AP_BoardConfig: added detection of Holybro6X-45686

This commit is contained in:
Andrew Tridgell 2024-01-21 15:36:29 +11:00
parent 34188e892f
commit a25f10a914
2 changed files with 7 additions and 0 deletions

View File

@ -68,6 +68,7 @@ public:
FMUV6_BOARD_HOLYBRO_6X = 40,
FMUV6_BOARD_CUAV_6X = 41,
FMUV6_BOARD_HOLYBRO_6X_REV6 = 42,
FMUV6_BOARD_HOLYBRO_6X_45686 = 43,
PX4_BOARD_OLDDRIVERS = 100,
};

View File

@ -107,6 +107,7 @@ void AP_BoardConfig::board_setup_drivers(void)
case PX4_BOARD_MINDPXV2:
case FMUV6_BOARD_HOLYBRO_6X:
case FMUV6_BOARD_HOLYBRO_6X_REV6:
case FMUV6_BOARD_HOLYBRO_6X_45686:
case FMUV6_BOARD_CUAV_6X:
break;
default:
@ -499,6 +500,11 @@ void AP_BoardConfig::detect_fmuv6_variant()
state.board_type.set_and_notify(FMUV6_BOARD_CUAV_6X);
DEV_PRINTF("Detected CUAV 6X\n");
AP_Param::load_defaults_file("@ROMFS/param/CUAV_V6X_defaults.parm", false);
} else if (spi_check_register("icm45686-1", INV3REG_456_WHOAMI, INV3_WHOAMI_ICM45686) &&
spi_check_register("icm45686-2", INV3REG_456_WHOAMI, INV3_WHOAMI_ICM45686) &&
spi_check_register("icm45686-3", INV3REG_456_WHOAMI, INV3_WHOAMI_ICM45686)) {
state.board_type.set_and_notify(FMUV6_BOARD_HOLYBRO_6X_45686);
DEV_PRINTF("Detected Holybro 6X_45686\n");
} else if (spi_check_register("iim42652", INV3REG_WHOAMI, INV3_WHOAMI_IIM42652) &&
spi_check_register("icm45686", INV3REG_456_WHOAMI, INV3_WHOAMI_ICM45686)) {
state.board_type.set_and_notify(FMUV6_BOARD_HOLYBRO_6X_REV6);