Transmit BQ CRC big-endian
This commit is contained in:
parent
705b9da821
commit
d54635c17e
@ -53,10 +53,9 @@ uint16_t Calculate_CRC(uint8_t* message_buffer, uint16_t bufferlength) {
|
|||||||
wCRC = crc16_table[wCRC & 0x00FF] ^ (wCRC >> 8);
|
wCRC = crc16_table[wCRC & 0x00FF] ^ (wCRC >> 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
message_buffer[bufferlength - 1] =
|
// CRC is transmitted big-endian in the last two bytes of the message
|
||||||
(wCRC >> 8) & 0xFF; // Upper CRC Byte is LSB of CRC
|
message_buffer[bufferlength - 2] = wCRC & 0xFF;
|
||||||
message_buffer[bufferlength - 2] = (wCRC)&0xFF; // Lower CRC Byte is MSB of
|
message_buffer[bufferlength - 1] = (wCRC >> 8) & 0xFF;
|
||||||
// CRC
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user