Browse Source

AP_HAL_FLYMAPLE: RCInput now more robust in the face of connect/disconnect of

a PPM-SUM source

Also remove some left over debug code.
mission-4.1.18
Mike McCauley 11 years ago
parent
commit
6f04e5f2e7
  1. 10
      libraries/AP_HAL_FLYMAPLE/RCInput.cpp

10
libraries/AP_HAL_FLYMAPLE/RCInput.cpp

@ -82,22 +82,18 @@ void FLYMAPLERCInput::_timer_capt_cb(void) @@ -82,22 +82,18 @@ void FLYMAPLERCInput::_timer_capt_cb(void)
// sync pulse detected. Pass through values if at least a minimum number of channels received
if( channel_ctr >= FLYMAPLE_RC_INPUT_MIN_CHANNELS ) {
_valid_channels = channel_ctr;
// Clear any remaining channels, in case they were corrupted during a connect or something
while (channel_ctr < FLYMAPLE_RC_INPUT_NUM_CHANNELS)
_pulse_capt[channel_ctr++] = 0;
}
channel_ctr = 0;
} else {
if (channel_ctr < FLYMAPLE_RC_INPUT_NUM_CHANNELS) {
if (channel_ctr == 6)
// fixme:
digitalWrite(2, 1);
_pulse_capt[channel_ctr] = pulse_width;
channel_ctr++;
if (channel_ctr == FLYMAPLE_RC_INPUT_NUM_CHANNELS) {
_valid_channels = FLYMAPLE_RC_INPUT_NUM_CHANNELS;
}
// FIXME
digitalWrite(2, 0);
}
}
previous_count = current_count;

Loading…
Cancel
Save