diff --git a/libraries/AP_Math/crc.cpp b/libraries/AP_Math/crc.cpp index 985a02c290..de81543b48 100644 --- a/libraries/AP_Math/crc.cpp +++ b/libraries/AP_Math/crc.cpp @@ -599,13 +599,19 @@ uint8_t parity(uint8_t byte) return p; } -// sums the bytes in the supplied buffer, returns that sum mod 256 -// (i.e. shoved into a uint8_t) -uint8_t crc_sum_of_bytes(uint8_t *data, uint16_t count) +// sums the bytes in the supplied buffer, returns that sum mod 0xFFFF +uint16_t crc_sum_of_bytes_16(const uint8_t *data, uint16_t count) { - uint8_t ret = 0; + uint16_t ret = 0; for (uint32_t i=0; i