diff --git a/libraries/AP_HAL_ChibiOS/hwdef/Pixhawk6X/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/Pixhawk6X/hwdef.dat index 1cf5be3a9f743..c5c0158d971e2 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/Pixhawk6X/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/Pixhawk6X/hwdef.dat @@ -357,6 +357,8 @@ IMU Invensensev3 SPI:icm45686-2 ROTATION_ROLL_180 BOARD_MATCH(FMUV6_BOARD_HOLY IMU Invensensev3 SPI:icm45686-3 ROTATION_ROLL_180 BOARD_MATCH(FMUV6_BOARD_HOLYBRO_6X_45686) IMU Invensensev3 SPI:icm45686-1 ROTATION_YAW_90 BOARD_MATCH(FMUV6_BOARD_HOLYBRO_6X_45686) +IMU_HIGHRES_SAMPLE 7 BOARD_MATCH(FMUV6_BOARD_HOLYBRO_6X_45686) + define HAL_DEFAULT_INS_FAST_SAMPLE 7 # enable RAMTROM parameter storage diff --git a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py index 8744b43a3896f..6f6e560938b51 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py +++ b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py @@ -1675,6 +1675,14 @@ def write_IMU_config(self, f): if len(devlist) < 3: f.write('#define INS_MAX_INSTANCES %u\n' % len(devlist)) f.write('#define HAL_INS_PROBE_LIST %s\n\n' % ';'.join(devlist)) + highres = self.get_config('IMU_HIGHRES_SAMPLE', required=False, aslist=True) + if highres is not None: + if highres[-1].startswith("BOARD_MATCH("): + f.write('#define HAL_INS_HIGHRES_SAMPLE %s\n' % highres[0]) + f.write('#define HAL_INS_HIGHRES_SAMPLE_MASK (%s?HAL_INS_HIGHRES_SAMPLE:0)\n' % highres[-1]) + else: + f.write('#define HAL_INS_HIGHRES_SAMPLE %s\n' % highres[0]) + f.write('#define HAL_INS_HIGHRES_SAMPLE_MASK %s\n' % highres[0]) def write_MAG_config(self, f): '''write MAG config defines'''