refactoring: less hacky implementation

This commit is contained in:
Andrey 2021-11-11 19:58:43 -05:00
parent bfabe25f2e
commit aff7664c21
2 changed files with 4 additions and 2 deletions

View File

@ -94,7 +94,7 @@ public:
AcState acState;
bool enableOverdwellProtection = true;
bool isPwmEnabled = true;
int triggerActivitySecond = 0;
int triggerActivitySecond = -99;
const char *prevOutputName = nullptr;

View File

@ -720,7 +720,9 @@ void runHardcodedFsio(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
}
// see FUEL_PUMP_LOGIC
if (isBrainPinValid(CONFIG(fuelPumpPin))) {
enginePins.fuelPumpRelay.setValue((getTimeNowSeconds() < engine->triggerActivitySecond + engineConfiguration->startUpFuelPumpDuration) || (engine->rpmCalculator.getRpm() > 0));
int triggerActivityOrEcuStartSecond = maxI(0, engine->triggerActivitySecond);
enginePins.fuelPumpRelay.setValue((getTimeNowSeconds() < triggerActivityOrEcuStartSecond + engineConfiguration->startUpFuelPumpDuration) || (engine->rpmCalculator.getRpm() > 0));
}
enginePins.o2heater.setValue(engine->rpmCalculator.isRunning());