mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-05 14:17:20 +08:00
Revist:Back out fix for secondary issue
Ultimate we want this changes that is being backed out herein. But it is breaking things because it returns the EINVAL when there is a rate overlap. So the rest of the pwm ioctl calls then fail and do not set the pulse widths on arming. As a secondary issue. We sould call up_pwm_servo_init() to establish the PWM channel allocation early. This then allows FMU::set_pwm_rate to properly check for improper rate request not isolate to one group (timer).
This commit is contained in:
committed by
Lorenz Meier
parent
7322da3c19
commit
2a8eaa66ca
@@ -673,7 +673,6 @@ PX4FMU::set_mode(Mode mode)
|
|||||||
if (old_mask != _pwm_mask) {
|
if (old_mask != _pwm_mask) {
|
||||||
/* disable servo outputs - no need to set rates */
|
/* disable servo outputs - no need to set rates */
|
||||||
up_pwm_servo_deinit();
|
up_pwm_servo_deinit();
|
||||||
return OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -681,8 +680,8 @@ PX4FMU::set_mode(Mode mode)
|
|||||||
default:
|
default:
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
_mode = mode;
|
_mode = mode;
|
||||||
up_pwm_servo_init(_pwm_mask);
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1049,6 +1048,7 @@ void
|
|||||||
PX4FMU::update_pwm_out_state(bool on)
|
PX4FMU::update_pwm_out_state(bool on)
|
||||||
{
|
{
|
||||||
if (on && !_pwm_initialized && _pwm_mask != 0) {
|
if (on && !_pwm_initialized && _pwm_mask != 0) {
|
||||||
|
up_pwm_servo_init(_pwm_mask);
|
||||||
set_pwm_rate(_pwm_alt_rate_channels, _pwm_default_rate, _pwm_alt_rate);
|
set_pwm_rate(_pwm_alt_rate_channels, _pwm_default_rate, _pwm_alt_rate);
|
||||||
_pwm_initialized = true;
|
_pwm_initialized = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user