rx,crsf: fix CRSFv3 the numOfChannels calculation

This commit is contained in:
cruwaller 2021-05-25 12:54:29 +03:00
parent a2bbd31c9c
commit 1f0e48dd27
1 changed files with 1 additions and 1 deletions

View File

@ -551,7 +551,7 @@ STATIC_UNIT_TESTED uint8_t crsfFrameStatus(rxRuntimeState_t *rxRuntimeState)
configByte >>= CRSF_SUBSET_RC_RESERVED_CONFIGURATION_BITS;
// calculate the number of channels packed
uint8_t numOfChannels = ((crsfChannelDataFrame.frame.frameLength - CRSF_FRAME_LENGTH_TYPE_CRC) * 8 - CRSF_SUBSET_RC_STARTING_CHANNEL_BITS) / channelBits;
uint8_t numOfChannels = ((crsfChannelDataFrame.frame.frameLength - CRSF_FRAME_LENGTH_TYPE_CRC - 1) * 8) / channelBits;
// unpack the channel data
uint8_t bitsMerged = 0;