From 6c67032ef23a8b6046cc36673ae936f23ae00cb4 Mon Sep 17 00:00:00 2001 From: Stefan Brand Date: Sun, 2 May 2021 12:53:14 +0200 Subject: [PATCH] Initialize Checksum with 0 --- lib/HM330x/HM330x.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/HM330x/HM330x.cpp b/lib/HM330x/HM330x.cpp index a5269ec..05ae3c1 100644 --- a/lib/HM330x/HM330x.cpp +++ b/lib/HM330x/HM330x.cpp @@ -80,7 +80,7 @@ bool HM330x::sendCmd(uint8_t cmd) { // Calculate CRC8 uint8_t HM330x::calcSum(uint8_t bytes[]) { - uint8_t crc8; + uint8_t crc8 = 0; for (int i = 0; i < HM330x_DATA_LEN - 1; i++) { crc8 += bytes[i]; }