actuator outputs: always add reverse range param

and remove the possibility to set min > max to reverse.

Initially the idea was to add the checkbox on the UI side, to avoid adding
another param, but I don't think I'll go through the extra effort on the
QGC side.
This commit is contained in:
Beat Küng
2022-01-14 12:18:29 -05:00
committed by Daniel Agar
parent 98a9748bb8
commit 9ca58f5e97
11 changed files with 28 additions and 47 deletions
-1
View File
@@ -1,6 +1,5 @@
module_name: PWM Output
actuator_output:
add_reverse_range_param: true
output_groups:
- param_prefix: PWM_MAIN
channel_label: 'Channel'
-1
View File
@@ -1,6 +1,5 @@
module_name: '${PWM_MAIN_OR_AUX}'
actuator_output:
add_reverse_range_param: true
output_groups:
- generator: pwm
param_prefix: '${PWM_MAIN_OR_AUX}'
-1
View File
@@ -1,7 +1,6 @@
module_name: HIL
actuator_output:
add_reverse_range_param: true
show_subgroups_if: 'SYS_HITL>0'
output_groups:
- param_prefix: HIL_ACT
-1
View File
@@ -1,7 +1,6 @@
module_name: SIM
actuator_output:
add_reverse_range_param: true
output_groups:
- param_prefix: PWM_MAIN
channel_label: Channel
-1
View File
@@ -1,6 +1,5 @@
module_name: PWM MAIN
actuator_output:
add_reverse_range_param: true
output_groups:
- generator: pwm
param_prefix: PWM_MAIN
-1
View File
@@ -1,6 +1,5 @@
module_name: UAVCAN
actuator_output:
add_reverse_range_param: true
show_subgroups_if: 'UAVCAN_ENABLE>=3'
config_parameters:
- param: 'UAVCAN_ENABLE'
-1
View File
@@ -1,6 +1,5 @@
module_name: UAVCANv1
actuator_output:
add_reverse_range_param: true
output_groups:
- param_prefix: UCAN1_ESC
channel_label: 'ESC'
+2 -4
View File
@@ -193,8 +193,6 @@ void MixingOutput::updateParams()
bool function_changed = false;
_reverse_output_mask = 0;
for (unsigned i = 0; i < _max_num_outputs; i++) {
int32_t val;
@@ -219,7 +217,6 @@ void MixingOutput::updateParams()
}
if (_min_value[i] > _max_value[i]) {
_reverse_output_mask |= 1 << i;
uint16_t tmp = _min_value[i];
_min_value[i] = _max_value[i];
_max_value[i] = tmp;
@@ -230,10 +227,11 @@ void MixingOutput::updateParams()
}
}
_reverse_output_mask = 0;
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;
_reverse_output_mask = rev_range_param;
}
if (function_changed) {