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