This commit is contained in:
rusefi 2017-05-24 07:35:44 -04:00
parent 0d572f1e0e
commit bdf977a511
2 changed files with 20 additions and 0 deletions

View File

@ -139,6 +139,12 @@ void Engine::reset() {
}
FuelConsumptionState::FuelConsumptionState() {
perSecondConsumption = perSecondAccumulator = 0;
perMinuteConsumption = perMinuteAccumulator = 0;
accumulatedSecond = accumulatedMinute = -1;
}
EngineState::EngineState() {
dwellAngle = 0;
engineNoiseHipLevel = 0;

View File

@ -91,12 +91,26 @@ public:
void reset();
};
class FuelConsumptionState {
public:
FuelConsumptionState();
void addData(float durationMs);
float perSecondConsumption;
float perMinuteConsumption;
float perSecondAccumulator;
float perMinuteAccumulator;
int accumulatedSecond;
int accumulatedMinute;
};
class EngineState {
public:
EngineState();
void periodicFastCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE);
void updateSlowSensors(DECLARE_ENGINE_PARAMETER_SIGNATURE);
FuelConsumptionState fuelConsumption;
efitick_t crankingTime;
efitick_t timeSinceCranking;