mirror of https://github.com/arendst/Tasmota.git
KNX Lib: Fix 32bits decode
This commit is contained in:
parent
246c47d96e
commit
0648881cae
|
@ -83,5 +83,7 @@ uint32_t ESPKNXIP::data_to_4byte_uint(uint8_t *data)
|
|||
|
||||
float ESPKNXIP::data_to_4byte_float(uint8_t *data)
|
||||
{
|
||||
return (float)((data[1] << 24) | (data[2] << 16) | (data[3] << 8) |data[4]);
|
||||
}
|
||||
union { float f; uint32_t i; } num;
|
||||
num.i = (uint32_t)((data[1] << 24) | (data[2] << 16) | (data[3] << 8) | (data[4] << 0));
|
||||
return num.f;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue