mambrus / the-bus-pirate

Automatically exported from code.google.com/p/the-bus-pirate
Other
0 stars 1 forks source link

A CRC generator #7

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Add some facility to quickly calculate CRC values of a packet. Could use
the PIC24 hardware CRC generator.

Original issue reported on code.google.com by ianles...@gmail.com on 31 Mar 2009 at 2:28

GoogleCodeExporter commented 8 years ago
CRC16? Cant get you away with just a simple function like

        crc ^= a;
        for (i = 0; i < 8; ++i)
        {
            if (crc & 1)
                crc = (crc >> 1) ^ 0xA001;
            else
                crc = (crc >> 1);
        }

        return crc;

or am i confused

Original comment by BrentBXR on 2 Dec 2011 at 5:31