AP_BoardConfig: added BRD_IMU_TARGTEMP

set target temperature for IMU
This commit is contained in:
Andrew Tridgell 2016-06-15 18:28:18 +10:00
parent 834acaffee
commit 45c72eb442
2 changed files with 18 additions and 1 deletions

View File

@ -101,6 +101,15 @@ const AP_Param::GroupInfo AP_BoardConfig::var_info[] = {
// @Values: 0:Disabled,1:Enabled
AP_GROUPINFO("CAN_ENABLE", 6, AP_BoardConfig, _can_enable, 0),
#endif
#if HAL_HAVE_IMU_HEATER
// @Param: IMU_TARGTEMP
// @DisplayName: Target IMU temperature
// @Description: This sets the target IMU temperature for boards with controllable IMU heating units. A value of -1 disables heating.
// @Range: -1 80
// @Units: degreesC
AP_GROUPINFO("IMU_TARGTEMP", 7, AP_BoardConfig, _imu_target_temperature, HAL_IMU_TEMP_DEFAULT),
#endif
#if CONFIG_HAL_BOARD == HAL_BOARD_PX4
// @Param: SAFETY_MASK
@ -246,5 +255,10 @@ void AP_BoardConfig::init()
#elif CONFIG_HAL_BOARD == HAL_BOARD_VRBRAIN
/* configure the VRBRAIN driver for the right number of PWMs */
#endif
#endif
// let the HAL know the target temperature. We pass a pointer as
// we want the user to be able to change the parameter without
// rebooting
hal.util->set_imu_target_temp((int8_t *)&_imu_target_temperature);
}

View File

@ -35,4 +35,7 @@ private:
#if CONFIG_HAL_BOARD == HAL_BOARD_VRBRAIN
#endif
// target temperarure for IMU in Celsius, or -1 to disable
AP_Int8 _imu_target_temperature;
};