mirror of
https://github.com/Laxilef/OTGateway.git
synced 2025-12-11 18:54:28 +05:00
add method to f8.8, rename method from f8.8
This commit is contained in:
@@ -116,7 +116,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// converters
|
// converters
|
||||||
float f88(unsigned long response) {
|
float fromF88(unsigned long response) {
|
||||||
const byte valueLB = response & 0xFF;
|
const byte valueLB = response & 0xFF;
|
||||||
const byte valueHB = (response >> 8) & 0xFF;
|
const byte valueHB = (response >> 8) & 0xFF;
|
||||||
|
|
||||||
@@ -124,7 +124,11 @@ public:
|
|||||||
return value + (float) valueLB / 256.0;
|
return value + (float) valueLB / 256.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t s16(unsigned long response) {
|
template <class T> unsigned int toF88(T val) {
|
||||||
|
return (unsigned int) (val * 256);
|
||||||
|
}
|
||||||
|
|
||||||
|
int16_t fromS16(unsigned long response) {
|
||||||
const byte valueLB = response & 0xFF;
|
const byte valueLB = response & 0xFF;
|
||||||
const byte valueHB = (response >> 8) & 0xFF;
|
const byte valueHB = (response >> 8) & 0xFF;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user