Browse Source

HAL_PX4: send all channels to px4io

this allows for 16 channel SBUS out
mission-4.1.18
Andrew Tridgell 9 years ago
parent
commit
2a6e64e358
  1. 9
      libraries/AP_HAL_PX4/RCOutput.cpp

9
libraries/AP_HAL_PX4/RCOutput.cpp

@ -399,11 +399,10 @@ void PX4RCOutput::_timer_tick(void) @@ -399,11 +399,10 @@ void PX4RCOutput::_timer_tick(void)
if (_need_update && _pwm_fd != -1) {
_need_update = false;
perf_begin(_perf_rcout);
if (_max_channel <= _servo_count) {
::write(_pwm_fd, _period, _max_channel*sizeof(_period[0]));
} else {
// we're using both sets of outputs
::write(_pwm_fd, _period, _servo_count*sizeof(_period[0]));
// always send all outputs to first PWM device. This ensures that SBUS is properly updated in px4io
::write(_pwm_fd, _period, _max_channel*sizeof(_period[0]));
if (_max_channel > _servo_count) {
// maybe send updates to alt_fd
if (_alt_fd != -1 && _alt_servo_count > 0) {
uint8_t n = _max_channel - _servo_count;
if (n > _alt_servo_count) {

Loading…
Cancel
Save