mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-15 04:15:44 +03:00
Fixed bug in SUMD V3 channel number handling.
This commit is contained in:
parent
8239950c7d
commit
32bcf606b5
1 changed files with 2 additions and 5 deletions
|
@ -112,8 +112,6 @@ static uint8_t sumdFrameStatus(rxRuntimeConfig_t *rxRuntimeConfig)
|
|||
{
|
||||
UNUSED(rxRuntimeConfig);
|
||||
|
||||
uint8_t channelIndex;
|
||||
|
||||
uint8_t frameStatus = RX_FRAME_PENDING;
|
||||
|
||||
if (!sumdFrameDone) {
|
||||
|
@ -139,10 +137,9 @@ static uint8_t sumdFrameStatus(rxRuntimeConfig_t *rxRuntimeConfig)
|
|||
return frameStatus;
|
||||
}
|
||||
|
||||
if (sumdChannelCount > MAX_SUPPORTED_RC_CHANNEL_COUNT)
|
||||
sumdChannelCount = MAX_SUPPORTED_RC_CHANNEL_COUNT;
|
||||
unsigned channelsToProcess = MIN(sumdChannelCount, MAX_SUPPORTED_RC_CHANNEL_COUNT);
|
||||
|
||||
for (channelIndex = 0; channelIndex < sumdChannelCount; channelIndex++) {
|
||||
for (unsigned channelIndex = 0; channelIndex < channelsToProcess; 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_LOW]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue