mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 14:03:33 +08:00
output drivers: add option to generate a separate output range reversing param
Makes it a bit easier to configure. Reversing by setting MIN > MAX is still supported.
This commit is contained in:
@@ -138,6 +138,9 @@ void MixingOutput::initParamHandles()
|
||||
snprintf(param_name, sizeof(param_name), "%s_%s%d", _param_prefix, "FAIL", i + 1);
|
||||
_param_handles[i].failsafe = param_find(param_name);
|
||||
}
|
||||
|
||||
snprintf(param_name, sizeof(param_name), "%s_%s", _param_prefix, "REV");
|
||||
_param_handle_rev_range = param_find(param_name);
|
||||
}
|
||||
|
||||
void MixingOutput::printStatus() const
|
||||
@@ -230,6 +233,12 @@ void MixingOutput::updateParams()
|
||||
}
|
||||
}
|
||||
|
||||
int32_t rev_range_param;
|
||||
|
||||
if (_param_handle_rev_range != PARAM_INVALID && param_get(_param_handle_rev_range, &rev_range_param) == 0) {
|
||||
_reverse_output_mask |= rev_range_param;
|
||||
}
|
||||
|
||||
if (function_changed) {
|
||||
_need_function_update = true;
|
||||
}
|
||||
|
||||
@@ -346,6 +346,7 @@ private:
|
||||
bool _has_backup_schedule{false};
|
||||
const char *const _param_prefix;
|
||||
ParamHandles _param_handles[MAX_ACTUATORS];
|
||||
param_t _param_handle_rev_range{PARAM_INVALID};
|
||||
hrt_abstime _lowrate_schedule_interval{300_ms};
|
||||
ActuatorTest _actuator_test{_function_assignment};
|
||||
uint32_t _reversible_mask{0}; ///< per-output bits. If set, the output is configured to be reversible (motors only)
|
||||
|
||||
Reference in New Issue
Block a user