+/* Functions and types for CRC checks.
+ *
+ * Generated on Wed Sep 21 22:30:11 2011,
+ * by pycrc v0.7.8, http://www.tty1.net/pycrc/
+ * using the configuration:
+ * Width = 15
+ * Poly = 0x4599
+ * XorIn = 0x0000
+ * ReflectIn = False
+ * XorOut = 0x0000
+ * ReflectOut = False
+ * Algorithm = table-driven
+ *****************************************************************************/
+typedef uint16_t crc_t;
+
+static const crc_t crc_table[2] = {
+ 0x0000, 0x4599
+};
+
+crc_t crc_update(crc_t crc, uint32_t data, size_t bit_len)
+{
+ unsigned int tbl_idx;
+/* crc_t bc = crc; */
+/* uint32_t bd = data; */
+/* size_t bl = bit_len; */
+
+ while (bit_len--) {
+ tbl_idx = (crc >> 14) ^ (data >> 31);
+ crc = crc_table[tbl_idx & 0x01] ^ (crc << 1);
+ data <<= 1;
+ }
+ crc = crc & 0x7fff;
+/* printf("crc: 0x%04x -> 0x%04x data: 0x%08x len: %d\n", */
+/* bc, crc, bd, bl); */
+ return crc;
+}
+