1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 00:05:33 +03:00

fix error of unittest

This commit is contained in:
azolyoung 2018-09-21 17:00:47 +08:00
parent ba53fbddd5
commit 6bc6c36116
4 changed files with 39 additions and 10 deletions

View file

@ -91,7 +91,7 @@ static rcdeviceResponseParseContext_t* rcdeviceRespCtxQueuePeekFront(rcdeviceWai
return ctx;
}
static rcdeviceResponseParseContext_t* rcdeviceRespCtxQueueShift(rcdeviceWaitingResponseQueue *queue)
rcdeviceResponseParseContext_t* rcdeviceRespCtxQueueShift(rcdeviceWaitingResponseQueue *queue)
{
if (queue == NULL || queue->itemCount == 0) {
return NULL;
@ -387,6 +387,7 @@ void rcdeviceReceive(timeUs_t currentTimeUs)
for (int i = 0; i < respCtx->recvRespLen; i++) {
crc = crc8_dvb_s2(crc, respCtx->recvBuf[i]);
}
respCtx->result = (crc == 0) ? RCDEVICE_RESP_SUCCESS : RCDEVICE_RESP_INCORRECT_CRC;
} else if (respCtx->protocolVer == RCDEVICE_PROTOCOL_RCSPLIT_VERSION) {
// do nothing, just call parserFunc