OBD CAN sensors #1733
This commit is contained in:
parent
3b5ef55d15
commit
4e06bee9aa
|
@ -37,20 +37,26 @@ public:
|
||||||
return unexpected;
|
return unexpected;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_timeoutPeriod != 0) { // zero m_timeoutPeriod means value lasts forever
|
||||||
if (getTimeNowNt() - m_timeoutPeriod > m_lastUpdate) {
|
if (getTimeNowNt() - m_timeoutPeriod > m_lastUpdate) {
|
||||||
return unexpected;
|
return unexpected;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
void showInfo(Logging* logger, float testInputValue) const {
|
||||||
explicit StoredValueSensor(SensorType type, efitick_t timeoutNt)
|
|
||||||
|
}
|
||||||
|
|
||||||
|
StoredValueSensor(SensorType type, efitick_t timeoutNt)
|
||||||
: Sensor(type)
|
: Sensor(type)
|
||||||
, m_timeoutPeriod(timeoutNt)
|
, m_timeoutPeriod(timeoutNt)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
// Invalidate the stored value.
|
// Invalidate the stored value.
|
||||||
void invalidate() {
|
void invalidate() {
|
||||||
m_isValid = false;
|
m_isValid = false;
|
||||||
|
|
Loading…
Reference in New Issue