Code Review
/
apps
/
hvac.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fix math for temp
[apps/hvac.git]
/
binding
/
hvac-demo-binding.c
diff --git
a/binding/hvac-demo-binding.c
b/binding/hvac-demo-binding.c
index
4913380
..
3eb1876
100644
(file)
--- a/
binding/hvac-demo-binding.c
+++ b/
binding/hvac-demo-binding.c
@@
-148,7
+148,7
@@
static int open_can_dev()
// Get original get temperature function from cpp hvacplugin code
static uint8_t to_can_temp(uint8_t value)
{
// Get original get temperature function from cpp hvacplugin code
static uint8_t to_can_temp(uint8_t value)
{
- int result = ((0xF0 - 0x10) / 15) *
value - 16
;
+ int result = ((0xF0 - 0x10) / 15) *
(value - 15) + 0x10
;
if (result < 0x10)
result = 0x10;
if (result > 0xF0)
if (result < 0x10)
result = 0x10;
if (result > 0xF0)