Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
rusefi committed May 24, 2017
1 parent 7b90958 commit 75dc730
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions firmware/controllers/algo/engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@ void Engine::reset() {

}

FuelConsumptionState::FuelConsumptionState() {
perSecondConsumption = perSecondAccumulator = 0;
perMinuteConsumption = perMinuteAccumulator = 0;
accumulatedSecond = accumulatedMinute = -1;
}

EngineState::EngineState() {
dwellAngle = 0;
engineNoiseHipLevel = 0;
Expand Down
14 changes: 14 additions & 0 deletions firmware/controllers/algo/engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,26 @@ class SensorsState {
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;
Expand Down

0 comments on commit 75dc730

Please sign in to comment.