mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-12 22:50:35 +08:00
mixer_module: send a last sample out after all outputs were disabled
This matters for PWM when the last output gets disabled on either FMU or IO it would just keep on running. Also when rebooting with a parameters reset or new airframe with no mapped outputs it would previously keep outputting PWM with the disarmed value of the new airframe e.g. 1000us which is a safety hazard because servos could break the physical limit of the model or miscalibrated ESCs spinning motors.
This commit is contained in:
@@ -455,7 +455,8 @@ bool MixingOutput::update()
|
||||
}
|
||||
}
|
||||
|
||||
if (!all_disabled) {
|
||||
// Send output if any function mapped or one last disabling sample
|
||||
if (!all_disabled || !_was_all_disabled) {
|
||||
if (!_armed.armed && !_armed.manual_lockdown) {
|
||||
_actuator_test.overrideValues(outputs, _max_num_outputs);
|
||||
}
|
||||
@@ -463,6 +464,8 @@ bool MixingOutput::update()
|
||||
limitAndUpdateOutputs(outputs, has_updates);
|
||||
}
|
||||
|
||||
_was_all_disabled = all_disabled;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user