This commit is contained in:
2023-12-24 21:42:43 +01:00
parent 6703a07e0f
commit 56b996cfd5
4 changed files with 14 additions and 9 deletions

View File

@@ -1,7 +1,7 @@
#include "tinycrc.h"
/*
CRC16
CRC16 (from https://stackoverflow.com/questions/10564491/function-to-calculate-a-crc16-checksum)
*/
uint16_t tinycrc_crc16(const uint8_t *data, uint16_t size)
@@ -19,4 +19,4 @@ uint16_t tinycrc_crc16(const uint8_t *data, uint16_t size)
crc = (crc << 8) ^ ((unsigned short)(x << 12)) ^ ((unsigned short)(x <<5)) ^ ((unsigned short)x);
}
return crc & 0xFFFF;
}
}