Commit 577f1656 authored by Michael Ott's avatar Michael Ott
Browse files

Apply factor also for unsigned readings

parent d8b0a672
...@@ -233,9 +233,9 @@ public: ...@@ -233,9 +233,9 @@ public:
if( _delta ) { if( _delta ) {
if (!_firstReading) { if (!_firstReading) {
if (rawReading.value < _lastRawUValue.value) if (rawReading.value < _lastRawUValue.value)
reading.value = (rawReading.value + (_deltaMax - _lastRawUValue.value)) * factor; reading.value = (rawReading.value + (_deltaMax - _lastRawUValue.value)) * factor * _factor;
else else
reading.value = (rawReading.value - _lastRawUValue.value) * factor; reading.value = (rawReading.value - _lastRawUValue.value) * factor * _factor;
} else { } else {
_firstReading = false; _firstReading = false;
_lastRawUValue = rawReading; _lastRawUValue = rawReading;
...@@ -244,7 +244,7 @@ public: ...@@ -244,7 +244,7 @@ public:
_lastRawUValue = rawReading; _lastRawUValue = rawReading;
} }
else else
reading.value = rawReading.value * factor; reading.value = rawReading.value * factor * _factor;
storeReadingLocal(reading); storeReadingLocal(reading);
if (storeGlobal) { if (storeGlobal) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment