uint8 normalChecksum8(uint8 *b, int n) { int i; uint16 a, bb; //Sums bytes 1 to n-1 unsigned to a 2 byte value. Sums quotient and //remainder of 256 division. Again, sums quotient and remainder of //256 division. for(i = 1, a = 0; i < n; i++) a+=(uint16)b[i]; bb = a / 256; a = (a - 256 * bb) + bb; bb = a / 256; return (uint8)((a-256*bb)+bb); }