Something something Automatic Compression Release #3442

This commit is contained in:
Andrey 2021-11-11 20:16:34 -05:00
parent 7d3d93d469
commit 1aca049c47
3 changed files with 3 additions and 3 deletions

View File

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

View File

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

View File

@ -403,7 +403,7 @@ void mainTriggerCallback(uint32_t trgEventIndex, efitick_t edgeTimestamp DECLARE
*/
enginePins.fuelPumpRelay.setValue(true); // quickly set pin right from the callback here! todo: would it work OK for smart SPI pin?!
#if EFI_PROD_CODE
engine->triggerActivitySecond = getTimeNowSeconds();
engine->triggerActivityMs = currentTimeMillis();
#endif
// todo: check for 'trigger->is_synchnonized?'
// TODO: add 'pin shutdown' invocation somewhere - coils might be still open here!