File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -112,8 +112,6 @@ static uint8_t sumdFrameStatus(rxRuntimeConfig_t *rxRuntimeConfig)
112
112
{
113
113
UNUSED (rxRuntimeConfig );
114
114
115
- uint8_t channelIndex ;
116
-
117
115
uint8_t frameStatus = RX_FRAME_PENDING ;
118
116
119
117
if (!sumdFrameDone ) {
@@ -139,10 +137,9 @@ static uint8_t sumdFrameStatus(rxRuntimeConfig_t *rxRuntimeConfig)
139
137
return frameStatus ;
140
138
}
141
139
142
- if (sumdChannelCount > MAX_SUPPORTED_RC_CHANNEL_COUNT )
143
- sumdChannelCount = MAX_SUPPORTED_RC_CHANNEL_COUNT ;
140
+ unsigned channelsToProcess = MIN (sumdChannelCount , MAX_SUPPORTED_RC_CHANNEL_COUNT );
144
141
145
- for (channelIndex = 0 ; channelIndex < sumdChannelCount ; channelIndex ++ ) {
142
+ for (unsigned channelIndex = 0 ; channelIndex < channelsToProcess ; channelIndex ++ ) {
146
143
sumdChannels [channelIndex ] = (
147
144
(sumd [SUMD_BYTES_PER_CHANNEL * channelIndex + SUMD_OFFSET_CHANNEL_1_HIGH ] << 8 ) |
148
145
sumd [SUMD_BYTES_PER_CHANNEL * channelIndex + SUMD_OFFSET_CHANNEL_1_LOW ]
You can’t perform that action at this time.
0 commit comments