mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 14:33:34 +08:00
fix pwm: only update oneshot timers owned by the current pwm_out instance
This fixes the case where oneshot was enabled with multi-instance pwm_out, triggering oneshot updates too close to each other and as a result could lead to spinning motors while disarmed.
This commit is contained in:
@@ -358,7 +358,7 @@ __EXPORT extern int up_pwm_servo_set_rate_group_update(unsigned group, unsigned
|
||||
* Nothing is done if not in oneshot mode.
|
||||
*
|
||||
*/
|
||||
__EXPORT extern void up_pwm_update(void);
|
||||
__EXPORT extern void up_pwm_update(unsigned channel_mask);
|
||||
|
||||
/**
|
||||
* Set the current output value for a channel.
|
||||
|
||||
@@ -438,7 +438,7 @@ bool PWMOut::updateOutputs(bool stop_motors, uint16_t outputs[MAX_ACTUATORS],
|
||||
* the oneshots with updated values.
|
||||
*/
|
||||
if (num_control_groups_updated > 0) {
|
||||
up_pwm_update(); // TODO: review for multi
|
||||
up_pwm_update(_pwm_mask);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user