Browse Source

fixed DataLogger bug

master
Youen Toupin 3 years ago
parent
commit
61c5bb090f
  1. 6
      ESP32/src/DataLogger.h

6
ESP32/src/DataLogger.h

@ -12,11 +12,11 @@ public:
bool isDifferent(const Entry& other) bool isDifferent(const Entry& other)
{ {
const float scale = speed > 0.0f ? 1.0f : 5.0f; const float scale = speed > 0.0f || other.speed > 0.0f ? 1.0f : 5.0f;
return return
std::abs(batteryVoltage - other.batteryVoltage) > 0.1f * scale std::abs(batteryVoltage - other.batteryVoltage) > 0.1f * scale
&& std::abs(batteryOutputCurrent - other.batteryOutputCurrent) > 0.1f * scale || std::abs(batteryOutputCurrent - other.batteryOutputCurrent) > 0.1f * scale
&& std::abs(speed - other.speed) > 0.1f; || std::abs(speed - other.speed) > 0.1f;
} }
}; };

Loading…
Cancel
Save