Commit 2c9d4b4d authored by Michael Ott's avatar Michael Ott
Browse files

Fix check for outdated cache entries in SensorCache::getAverage()

parent c9634880
...@@ -67,8 +67,7 @@ int64_t SensorCache::getAverage(cacheEntry_t &entry, uint64_t avg) { ...@@ -67,8 +67,7 @@ int64_t SensorCache::getAverage(cacheEntry_t &entry, uint64_t avg) {
TimeStamp ts; TimeStamp ts;
if (entry.size() > 0) { if (entry.size() > 0) {
//std::cout << ts.getRaw() - entry.back().timestamp << std::endl; if (ts.getRaw() - entry.front().timestamp < avg * NS_PER_S) {
if (ts.getRaw() - entry.back().timestamp > avg * NS_PER_S) {
throw std::out_of_range("Sid outdated"); throw std::out_of_range("Sid outdated");
return 0; return 0;
} }
......
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