4/14/2016
D014465 CR1400 CR1000 CR2300 CR2600 CR3600 CR44X5 CR8000 CR900FD CR6000 CR5000 T500 Client Version ICD
Page 102 of 106
© 2013-2016 The Code Corporation
12393 South Gateway Park Place Suite 600, Draper, UT 84020
(801) 495-2200
FAX (801) 495-0280
#include <crc16.h>
crc_t crc
( crc_t initialCrc
, const unsigned char* p
, size_t n
)
{
enum
{
crcBits = 16,
charBits = 8,
diffBits = crcBits - charBits
};
crc_t c = initialCrc;
#include "crc16tab.h"
while( n-- )
c = (c << charBits) ^ crcTab[( c >> diffBits ) ^ *p++];
return c;
}
/*eof*/