less code is better

This commit is contained in:
Andrey 2022-08-31 23:14:20 -04:00
parent 039f70b18e
commit 4cbaddcc60
4 changed files with 4 additions and 6 deletions

View File

@ -642,7 +642,6 @@ static void updateFuelResults() {
engine->outputChannels.baseFuel = engine->engineState.baseFuel * 1000; // Convert grams to mg
engine->outputChannels.fuelRunning = engine->engineState.running.fuel;
engine->outputChannels.actualLastInjection = engine->actualLastInjection[0];
engine->outputChannels.fuelFlowRate = engine->engineState.fuelConsumption.getConsumptionGramPerSecond();
engine->outputChannels.totalFuelConsumption = engine->engineState.fuelConsumption.getConsumedGrams();

View File

@ -344,9 +344,6 @@ public:
float stftCorrection[STFT_BANK_COUNT] = {0};
// Stores the actual pulse duration of the last injection for every cylinder
floatms_t actualLastInjection[MAX_CYLINDER_COUNT] = {0};
// Standard cylinder air charge - 100% VE at standard temperature, grams per cylinder
float standardAirCharge = 0;

View File

@ -133,7 +133,7 @@ struct Fueling {
static void populateFrame(Fueling& msg) {
msg.cylAirmass = engine->engineState.sd.airMassInOneCylinder;
msg.estAirflow = engine->engineState.airflowEstimate;
msg.fuel_pulse = engine->actualLastInjection[0];
msg.fuel_pulse = (float)engine->outputChannels.actualLastInjection;
msg.knockCount = engine->module<KnockController>()->getKnockCount();
}

View File

@ -207,7 +207,9 @@ void InjectionEvent::onTriggerTooth(int rpm, efitick_t nowNt, float currentPhase
engine->engineState.fuelConsumption.consumeFuel(injectionMassGrams * numberOfInjections, nowNt);
engine->actualLastInjection[this->cylinderNumber] = injectionDuration;
if (this->cylinderNumber == 0) {
engine->outputChannels.actualLastInjection = injectionDuration;
}
if (cisnan(injectionDuration)) {
warning(CUSTOM_OBD_NAN_INJECTION, "NaN injection pulse");