Skip to content

Commit

Permalink
Update can_processor.cpp
Browse files Browse the repository at this point in the history
change from uint to int. Concat whole temperature message payload.
  • Loading branch information
Neuroquila-n8fall committed Dec 20, 2022
1 parent 4f1dfaf commit 3067eb3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/can_processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3067eb3

Please sign in to comment.