]> git.gag.com Git - fw/sdcc/blob - device/examples/crc.c
* *.dsw, *.dsp: changed property svn:eol-style to CRLF since they
[fw/sdcc] / 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 }