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);
|
||||
}
|
||||
|
||||
message_buffer[bufferlength - 1] =
|
||||
(wCRC >> 8) & 0xFF; // Upper CRC Byte is LSB of CRC
|
||||
message_buffer[bufferlength - 2] = (wCRC)&0xFF; // Lower CRC Byte is MSB of
|
||||
// CRC
|
||||
// CRC is transmitted big-endian in the last two bytes of the message
|
||||
message_buffer[bufferlength - 2] = wCRC & 0xFF;
|
||||
message_buffer[bufferlength - 1] = (wCRC >> 8) & 0xFF;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue