You know those aren't CRC (Cyclic Redundancy Check) routines, but rather a VERY weak parity check, right?
This is what a CRC looks like using one of the standard 16-bit polynomials. This is a bitwise method, but could be done faster with 4-bit or 8-bit parallel methods using tables.
Code:
uint16 CRC16(uint16 crc, int count, uint8 *buffer)
{
int i;
while(count--)
{
crc ^= ((uint16)*buffer++) << 8;
i = 8;
while(i--)
if (crc & 0x8000)
crc = (crc << 1) ^ 0x1021;
else
crc <<= 1;
}
return crc;
}
printf("CRC16 %04X\n", CRC16(0xFFFF,0x200,SectorBuffer));