From 075c53096240e056df62c8f457930799e5ad242b Mon Sep 17 00:00:00 2001 From: merlokk <807634+merlokk@users.noreply.github.com> Date: Mon, 18 Jul 2022 10:11:13 +0300 Subject: [PATCH] fix crc --- client/src/cmdhftexkom.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client/src/cmdhftexkom.c b/client/src/cmdhftexkom.c index 07ca40d29..b62460e6c 100644 --- a/client/src/cmdhftexkom.c +++ b/client/src/cmdhftexkom.c @@ -193,9 +193,11 @@ static uint8_t TexcomTK13CRC(const uint8_t *data) { static uint8_t MMBITCRC(const uint8_t *data) { return - (data[0] & 0x0f) ^ ((data[0] >> 4) & 0x0f) ^ - (data[1] & 0x0f) ^ ((data[1] >> 4) & 0x0f) ^ - (data[2] & 0x0f) ^ ((data[2] >> 4) & 0x0f); + (( (data[0] & 0x0f) ^ ((data[0] >> 4) & 0x0f) ^ + (data[1] & 0x0f) ^ ((data[1] >> 4) & 0x0f) ^ + (data[2] & 0x0f) ^ ((data[2] >> 4) & 0x0f) + ) ^ 0x0f + ) & 0x0f; } static unsigned char dallas_crc8(const unsigned char *data, const unsigned int size) {