Limit aux channel servo forwarding by max_aux_channels setting
No reason process forwarding for channels that aren't going to be active from the RX.
This commit is contained in:
parent
b58e8f827f
commit
003e89d747
|
@ -300,7 +300,8 @@ STATIC_UNIT_TESTED void forwardAuxChannelsToServos(uint8_t firstServoIndex)
|
|||
{
|
||||
// start forwarding from this channel
|
||||
int channelOffset = servoConfig()->channelForwardingStartChannel;
|
||||
for (int servoOffset = 0; servoOffset < MAX_AUX_CHANNEL_COUNT && channelOffset < MAX_SUPPORTED_RC_CHANNEL_COUNT; servoOffset++) {
|
||||
const int maxAuxChannelCount = MIN(MAX_AUX_CHANNEL_COUNT, rxConfig()->max_aux_channel);
|
||||
for (int servoOffset = 0; servoOffset < maxAuxChannelCount && channelOffset < MAX_SUPPORTED_RC_CHANNEL_COUNT; servoOffset++) {
|
||||
pwmWriteServo(firstServoIndex + servoOffset, rcData[channelOffset++]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue