Skip to content

Commit

Permalink
AP_HAL_ChibiOS: add support for swapping ICM42688 with ICM45686
Browse files Browse the repository at this point in the history
  • Loading branch information
bugobliterator authored and tridge committed Dec 6, 2023
1 parent e34e9c6 commit 00a6563
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions libraries/AP_HAL_ChibiOS/hwdef/CubeRedPrimary/hwdef.dat
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,18 @@ COMPASS RM3100 SPI:rm3100 false ROTATION_YAW_270
CHECK_ICM20649 spi_check_register_inv2("icm20649", INV2REG_WHOAMI, INV2_WHOAMI_ICM20649)

CHECK_ICM42688_0 spi_check_register("icm42688_0", INV3REG_WHOAMI, INV3_WHOAMI_ICM42688)
CHECK_ICM45686_0 spi_check_register("icm42688_0", INV3REG_456_WHOAMI, INV3_WHOAMI_ICM45686)

CHECK_ICM42688_1 spi_check_register("icm42688_1", INV3REG_WHOAMI, INV3_WHOAMI_ICM42688)
CHECK_ICM45686_1 spi_check_register("icm42688_1", INV3REG_456_WHOAMI, INV3_WHOAMI_ICM45686)

CHECK_MS5611_0 check_ms5611("ms5611_0")
CHECK_MS5611_1 check_ms5611("ms5611_1")


CHECK_IMU0_PRESENT $CHECK_ICM20649
CHECK_IMU1_PRESENT $CHECK_ICM42688_0
CHECK_IMU2_PRESENT $CHECK_ICM42688_1
CHECK_IMU1_PRESENT $CHECK_ICM42688_0 || $CHECK_ICM45686_0
CHECK_IMU2_PRESENT $CHECK_ICM42688_1 || $CHECK_ICM45686_1
CHECK_BARO0_PRESENT $CHECK_MS5611_0
CHECK_BARO1_PRESENT $CHECK_MS5611_1

Expand Down
3 changes: 2 additions & 1 deletion libraries/AP_HAL_ChibiOS/hwdef/CubeRedSecondary/hwdef.dat
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ BARO MS56XX SPI:ms5611
IMU Invensensev3 SPI:icm42688 ROTATION_PITCH_180_YAW_270

CHECK_ICM42688 spi_check_register("icm42688", INV3REG_WHOAMI, INV3_WHOAMI_ICM42688)
CHECK_ICM45686 spi_check_register("icm42688", INV3REG_456_WHOAMI, INV3_WHOAMI_ICM45686)
CHECK_MS5611 check_ms5611("ms5611")

CHECK_IMU0_PRESENT $CHECK_ICM42688
CHECK_IMU0_PRESENT $CHECK_ICM42688 || $CHECK_ICM45686
CHECK_BARO0_PRESENT $CHECK_MS5611

BOARD_VALIDATE $CHECK_IMU0_PRESENT $CHECK_BARO0_PRESENT
Expand Down

0 comments on commit 00a6563

Please sign in to comment.