diff --git a/lib/lib_div/esp-knx-ip-0.5.2/src/esp-knx-ip-conversion.cpp b/lib/lib_div/esp-knx-ip-0.5.2/src/esp-knx-ip-conversion.cpp index 9dc2fd563..06c5127a2 100644 --- a/lib/lib_div/esp-knx-ip-0.5.2/src/esp-knx-ip-conversion.cpp +++ b/lib/lib_div/esp-knx-ip-0.5.2/src/esp-knx-ip-conversion.cpp @@ -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]); -} \ No newline at end of file + 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; +}