Created
July 30, 2014 17:16
-
-
Save prof7bit/024648a550ab04cdb31f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
procedure CRC16_Xmodem_Update(var CRC: Word; Data: Byte); | |
var | |
I: Integer; | |
begin | |
CRC := CRC xor (Word(Data) shl 8); | |
for I := 0 to 7 do begin | |
if (CRC and $8000) <> 0 then | |
CRC := (CRC shl 1) xor $1021 | |
else | |
CRC := CRC shl 1; | |
end; | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment