Further additions to tidemod to differentiate between ro and rw tags and check crc validity.
This commit is contained in:
1 parent
1569d97730
commit
0c2ed92d87
3 files changed
+98
-23
No files matched your search
@@ -0,0 +1,11 @@
|
||||
unsigned short update_crc16( WORD crc, BYTE c ) {
|
||||
WORD i, v, tcrc = 0;
|
||||
|
||||
v = (crc ^ c) & 0xff;
|
||||
for (i = 0; i < 8; i++) {
|
||||
tcrc = ( (tcrc ^ v) & 1 ) ? ( tcrc >> 1 ) ^ 0x8408 : tcrc >> 1;
|
||||
v >>= 1;
|
||||
}
|
||||
|
||||
return (crc >> 8) ^ tcrc;
|
||||
}
|
||||
Reference in new issue
Block a user