La función devuelve el valor CRC como un entero sin signo.
Unsigned int crc_chk(unsigned char* data, unsigned char length){
return reg_crc;
}
DELTA ELECTRONICS, INC. ALL RIGHTS RESERVED
int j;
unsigned int reg_crc=0xFFFF;
while(length--){
reg_crc ^= *data++;
for(j=0;j<8;j++){
if(reg_crc & 0x01){ /* LSB(b0)=1 */
reg_crc=(reg_crc>>1) ^ 0xA001;
}else{
reg_crc=reg_crc >>1;
}
}
}
79
VFD-L Series