1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 22:35:23 +03:00

Fix the problem where RC channels would show up as 1498 with no receiver

connected instead of the 'midrc' value.

Achieved by deleting unnecessary legacy ardino code.

Discussion here:
http://www.multiwii.com/forum/viewtopic.php?f=8&t=5063&p=50635#p50634

Basically it was there because the Ardiuno PPMSUM timer resolution is
lower than the STM32 code we use.

With a Grapner GR-24 receiver using parallel PWM or PPM (12channel) the
values hardly fluctuate at all, slightly more noticable with parallel
PWM input.
This commit is contained in:
Dominic Clifton 2014-05-08 15:31:35 +01:00
parent 3c91ce6c8b
commit 185fd0f4c9

View file

@ -141,12 +141,7 @@ void computeRC(rxConfig_t *rxConfig, rxRuntimeConfig_t *rxRuntimeConfig)
for (sampleIndex = 0; sampleIndex < PPM_AND_PWM_SAMPLE_COUNT; sampleIndex++)
rcDataMean[chan] += rcSamples[chan][sampleIndex];
rcDataMean[chan] = (rcDataMean[chan] + 2) / PPM_AND_PWM_SAMPLE_COUNT;
if (rcDataMean[chan] < rcData[chan] - 3)
rcData[chan] = rcDataMean[chan] + 2;
if (rcDataMean[chan] > rcData[chan] + 3)
rcData[chan] = rcDataMean[chan] - 2;
rcData[chan] = rcDataMean[chan] / PPM_AND_PWM_SAMPLE_COUNT;
}
}