thanks iceman for the crc :)
csBuff[i] = bytebits_to_byte(BitStream + idx + 16 + (i*8), 8);
}
//check checksum calc
csBuff[i] = bytebits_to_byte(BitStream + idx + 16 + (i*8), 8);
}
//check checksum calc
+ //checksum calc thanks to ICEMAN!!
uint32_t checkCS = CRC8Maxim(csBuff,13);
//get raw ID before removing parities
uint32_t checkCS = CRC8Maxim(csBuff,13);
//get raw ID before removing parities
return ( crc->state ^ crc->final_xor ) & crc->mask;
}
return ( crc->state ^ crc->final_xor ) & crc->mask;
}
-uint32_t CRC8Maxim(uint8_t *buff, size_t size )
+//credits to iceman
+uint32_t CRC8Maxim(uint8_t *buff, size_t size)
{
crc_t crc;
crc_init(&crc, 9, 0x8c, 0x00, 0x00);
{
crc_t crc;
crc_init(&crc, 9, 0x8c, 0x00, 0x00);