Appendix 2 Crc16-Ccitt - Kipor KP310V1.0 Operation Manual

Table of Contents

Advertisement

Appendix 2 CRC16-CCITT

/*******************************************************************
Function:
generate CRC16CCITT code
Input:
p
DataLen =data length
Output:
CRC16CCITT
*******************************************************************/
Unsigned int CRC16CCITT (unsigned char *p, unsigned int DataLen)
{
Unsigned int crc16=0;
Unsigned int i;
Unsigned char b;
for (i=0;i<DataLen;i++)
{
b=(unsigned char)(crc16>>8);
crc16<<=8;
crc16^= CRC16CCITT [b^*p];
p++;
}
return crc16;
}
= mouse cursor points to first byte
- 30 -
KP310V1.0 Controller Operation Manual

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents