check_crc: add CRC_KERMIT
This commit is contained in:
@@ -230,7 +230,7 @@ uint16_t Crc16ex(CrcType_t ct, const uint8_t *d, size_t n) {
|
|||||||
// n length (including crc)
|
// n length (including crc)
|
||||||
//
|
//
|
||||||
// This function uses the message + crc bytes in order to compare the "residue" afterwards.
|
// This function uses the message + crc bytes in order to compare the "residue" afterwards.
|
||||||
// crc16 algos like CRC-A become 0x000
|
// crc16 algos like CRC-A become 0x0000
|
||||||
// while CRC-15693 become 0x0F47
|
// while CRC-15693 become 0x0F47
|
||||||
// If calculated with crc bytes, the residue should be 0xF0B8
|
// If calculated with crc bytes, the residue should be 0xF0B8
|
||||||
bool check_crc(CrcType_t ct, const uint8_t *d, size_t n) {
|
bool check_crc(CrcType_t ct, const uint8_t *d, size_t n) {
|
||||||
@@ -254,6 +254,8 @@ bool check_crc(CrcType_t ct, const uint8_t *d, size_t n) {
|
|||||||
return (crc16_xmodem(d, n) == 0);
|
return (crc16_xmodem(d, n) == 0);
|
||||||
case CRC_CCITT:
|
case CRC_CCITT:
|
||||||
return (crc16_ccitt(d, n) == 0);
|
return (crc16_ccitt(d, n) == 0);
|
||||||
|
case CRC_KERMIT:
|
||||||
|
return (crc16_kermit(d, n) == 0);
|
||||||
case CRC_LEGIC:
|
case CRC_LEGIC:
|
||||||
// TODO
|
// TODO
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user