From 3067eb367e82503f06b4cb49507cfe2f84b230ac Mon Sep 17 00:00:00 2001 From: Dave Ginsbach Date: Tue, 20 Dec 2022 23:06:22 +0100 Subject: [PATCH] Update can_processor.cpp change from uint to int. Concat whole temperature message payload. --- src/can_processor.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/can_processor.cpp b/src/can_processor.cpp index 9587dd0..0b64563 100644 --- a/src/can_processor.cpp +++ b/src/can_processor.cpp @@ -129,7 +129,7 @@ void processCan() * Endpoint = Outside temperature at which the heating should deliver the lowest possible feed temperature. Also known as "cut-off" temperature (depends on who you are talking with about this topic ;)) **************************************/ - unsigned int rawTemp; + int rawTemp; // Take note of the last time we received a message from the boiler if (Message.id < 0x250 || Message.id > 0x260) @@ -205,8 +205,12 @@ void processCan() // Value: (Data[0] & Data[1]) / 100.0 if (Message.id == configuration.CanAddresses.Heating.OutsideTemperature) { - // Concat bytes 0 and 1 and divide the resulting INT by 100 - rawTemp = (Message.data[0] << 8) + Message.data[1]; + // Concat payload and divide the resulting INT by 100 + for (int i = 0; i < sizeof(Message.data); i++) + { + rawTemp <<= 8; + rawTemp |= Message.data[i]; + } temp = rawTemp / 100.0; // Temperature Delta is too high