From d2073a52c1ba52749c1c9522c42ccbfc83b70b1d Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Wed, 6 Nov 2013 18:40:48 +0100 Subject: [PATCH 1/1] CRC must be shifted before conversion to big endian, not after --- latester/latester.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/latester/latester.c b/latester/latester.c index e19064a..b0937ba 100644 --- a/latester/latester.c +++ b/latester/latester.c @@ -204,7 +204,7 @@ uint32_t calc_bitmap_crc(uint32_t *bitmap, unsigned start, unsigned end) crc = crc_update(crc, bitmap[1], 32); crc = crc_update(crc, bitmap[2], end - 64 > 32 ? 32 : end - 64); crc = crc_update(crc, bitmap[3], end > 96 ? end - 96 : 0); - return (uint32_t)htons(crc) << 17; + return (uint32_t)htons(crc << 17); } void write_crc_to_bitmap(uint32_t crc, uint32_t *bitmap, struct can_frame *frame) -- 2.39.2