Browse Source

HAL_PX4: fixed oneshot125 on non-alt outputs

master
Andrew Tridgell 7 years ago
parent
commit
219d429929
  1. 3
      libraries/AP_HAL_PX4/RCOutput.cpp

3
libraries/AP_HAL_PX4/RCOutput.cpp

@ -356,11 +356,14 @@ void PX4RCOutput::write(uint8_t ch, uint16_t period_us) @@ -356,11 +356,14 @@ void PX4RCOutput::write(uint8_t ch, uint16_t period_us)
}
if (_output_mode == MODE_PWM_ONESHOT125) {
if (((ch < _servo_count) && ((1U<<ch) & _rate_mask_main)) ||
((ch >= _servo_count) && ((1U<<(ch-_servo_count)) & _rate_mask_alt))) {
// we treat oneshot125 very simply on HAL_PX4, with 1us
// resolution. Correctly handling it would use a 125 nsec
// step size, to give the full 1000 steps
period_us /= 8;
}
}
// keep unscaled value
_last_sent[ch] = period_us;

Loading…
Cancel
Save