AP_Param: fixed forced save of constructor override parameters

this fixes the problem where setting ATC_RAT_YAW_FILT to 20 in copter
didn't stick across reboots
This commit is contained in:
Andrew Tridgell 2016-05-24 16:55:45 +10:00
parent 7e1ef905d3
commit 1581a5e354

View File

@ -978,8 +978,9 @@ bool AP_Param::save(bool force_save)
GCS_MAVLINK::send_parameter_value_all(name, (enum ap_var_type)info->type, v2); GCS_MAVLINK::send_parameter_value_all(name, (enum ap_var_type)info->type, v2);
return true; return true;
} }
if (phdr.type != AP_PARAM_INT32 && if (!force_save &&
(fabsf(v1-v2) < 0.0001f*fabsf(v1))) { (phdr.type != AP_PARAM_INT32 &&
(fabsf(v1-v2) < 0.0001f*fabsf(v1)))) {
// for other than 32 bit integers, we accept values within // for other than 32 bit integers, we accept values within
// 0.01 percent of the current value as being the same // 0.01 percent of the current value as being the same
GCS_MAVLINK::send_parameter_value_all(name, (enum ap_var_type)info->type, v2); GCS_MAVLINK::send_parameter_value_all(name, (enum ap_var_type)info->type, v2);