refactor: removed unused methods, replaced some methods to native

This commit is contained in:
Yurii
2024-03-31 22:29:53 +03:00
parent 4490b38130
commit a7d796e0cc
2 changed files with 13 additions and 27 deletions

View File

@@ -163,24 +163,13 @@ public:
}
// converters
float fromF88(unsigned long response) {
const byte valueLB = response & 0xFF;
const byte valueHB = (response >> 8) & 0xFF;
float value = (int8_t)valueHB;
return value + (float)valueLB / 256.0;
}
template <class T> unsigned int toF88(T val) {
template <class T>
static unsigned int toFloat(const T val) {
return (unsigned int)(val * 256);
}
int16_t fromS16(unsigned long response) {
const byte valueLB = response & 0xFF;
const byte valueHB = (response >> 8) & 0xFF;
int16_t value = valueHB;
return ((value << 8) + valueLB);
static short getInt(const unsigned long response) {
return response & 0xffff;
}
protected: