1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-25 17:25:20 +03:00

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

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;