AP_Frsky_Telem: implement BRD_OPTIONS bit for setting of internal parameters

This commit is contained in:
Andrew Tridgell 2020-12-03 19:13:08 +11:00
parent d099af87b2
commit 12acc0724e
1 changed files with 7 additions and 0 deletions

View File

@ -207,6 +207,13 @@ void AP_Frsky_MAVliteMsgHandler::handle_param_set(const AP_Frsky_MAVlite_Message
if (vp == nullptr || isnan(param_value) || isinf(param_value)) {
return;
}
if (parameter_flags & AP_PARAM_FLAG_INTERNAL_USE_ONLY) {
// the user can set BRD_OPTIONS to enable set of internal
// parameters, for developer testing or unusual use cases
if (AP_BoardConfig::allow_set_internal_parameters()) {
parameter_flags &= ~AP_PARAM_FLAG_INTERNAL_USE_ONLY;
}
}
if ((parameter_flags & AP_PARAM_FLAG_INTERNAL_USE_ONLY) || vp->is_read_only()) {
gcs().send_text(MAV_SEVERITY_WARNING, "Param write denied (%s)", param_name);
} else if (!AP_Param::set_and_save(param_name, param_value)) {