mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-01 16:14:05 +01:00
17 lines
443 B
C++
17 lines
443 B
C++
// ArduinoJson - arduinojson.org
|
|
// Copyright Benoit Blanchon 2014-2018
|
|
// MIT License
|
|
|
|
#pragma once
|
|
|
|
namespace ARDUINOJSON_NAMESPACE {
|
|
|
|
inline void doubleToFloat(const uint8_t d[8], uint8_t f[4]) {
|
|
f[0] = uint8_t((d[0] & 0xC0) | (d[0] << 3 & 0x3f) | (d[1] >> 5));
|
|
f[1] = uint8_t((d[1] << 3) | (d[2] >> 5));
|
|
f[2] = uint8_t((d[2] << 3) | (d[3] >> 5));
|
|
f[3] = uint8_t((d[3] << 3) | (d[4] >> 5));
|
|
}
|
|
|
|
} // namespace ARDUINOJSON_NAMESPACE
|