Imported Upstream version 2.9.0
[debian/cc1111] / device / examples / crc.c
1 typedef unsigned char byte;
2
3 byte accum_checksum(byte cs, byte val)
4 {
5         unsigned int tmp;
6
7         tmp = ((cs<<7) | (cs>>1)) + val;
8
9         return (byte)tmp + ((byte) (tmp>>8) & 1);
10 }