Page 12 KKAI808PE01-A/0-20130904
unsigned int Get_CRC(uchar *pBuf, uchar num)
{
unsigned i,j;
unsigned int wCrc = 0xFFFF;
for(i=0; i<num; i++)
{
wCrc ^= (unsigned int)(pBuf[i]);
for(j=0; j<8; j++)
{
if(wCrc & 1){wCrc >>= 1; wCrc ^= 0xA001; }
else
wCrc >>= 1;
}
}
return wCrc;
}
16 digit CRC verify program