mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-15 12:25:20 +03:00
Merge pull request #7853 from mikeller/fix_sumd_v3
Fixed bug in SUMD V3 channel number handling.
This commit is contained in:
commit
ae5c924c96
1 changed files with 2 additions and 5 deletions
|
@ -112,8 +112,6 @@ static uint8_t sumdFrameStatus(rxRuntimeConfig_t *rxRuntimeConfig)
|
||||||
{
|
{
|
||||||
UNUSED(rxRuntimeConfig);
|
UNUSED(rxRuntimeConfig);
|
||||||
|
|
||||||
uint8_t channelIndex;
|
|
||||||
|
|
||||||
uint8_t frameStatus = RX_FRAME_PENDING;
|
uint8_t frameStatus = RX_FRAME_PENDING;
|
||||||
|
|
||||||
if (!sumdFrameDone) {
|
if (!sumdFrameDone) {
|
||||||
|
@ -139,10 +137,9 @@ static uint8_t sumdFrameStatus(rxRuntimeConfig_t *rxRuntimeConfig)
|
||||||
return frameStatus;
|
return frameStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sumdChannelCount > MAX_SUPPORTED_RC_CHANNEL_COUNT)
|
unsigned channelsToProcess = MIN(sumdChannelCount, MAX_SUPPORTED_RC_CHANNEL_COUNT);
|
||||||
sumdChannelCount = MAX_SUPPORTED_RC_CHANNEL_COUNT;
|
|
||||||
|
|
||||||
for (channelIndex = 0; channelIndex < sumdChannelCount; channelIndex++) {
|
for (unsigned channelIndex = 0; channelIndex < channelsToProcess; channelIndex++) {
|
||||||
sumdChannels[channelIndex] = (
|
sumdChannels[channelIndex] = (
|
||||||
(sumd[SUMD_BYTES_PER_CHANNEL * channelIndex + SUMD_OFFSET_CHANNEL_1_HIGH] << 8) |
|
(sumd[SUMD_BYTES_PER_CHANNEL * channelIndex + SUMD_OFFSET_CHANNEL_1_HIGH] << 8) |
|
||||||
sumd[SUMD_BYTES_PER_CHANNEL * channelIndex + SUMD_OFFSET_CHANNEL_1_LOW]
|
sumd[SUMD_BYTES_PER_CHANNEL * channelIndex + SUMD_OFFSET_CHANNEL_1_LOW]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue