add reset

This commit is contained in:
Matthew Kennedy 2020-07-14 23:54:41 -07:00
parent 47ea0940c6
commit c21b60eeb8
3 changed files with 9 additions and 0 deletions

View File

@ -57,6 +57,8 @@ public:
void addFuelEvents(DECLARE_ENGINE_PARAMETER_SIGNATURE); void addFuelEvents(DECLARE_ENGINE_PARAMETER_SIGNATURE);
bool addFuelEventsForCylinder(int cylinderIndex DECLARE_ENGINE_PARAMETER_SUFFIX); bool addFuelEventsForCylinder(int cylinderIndex DECLARE_ENGINE_PARAMETER_SUFFIX);
void resetOverlapping();
/** /**
* injection events, per cylinder * injection events, per cylinder
*/ */

View File

@ -166,6 +166,7 @@ void RpmCalculator::setRpmValue(float value DECLARE_ENGINE_PARAMETER_SUFFIX) {
// This presumably fixes injection mode change for cranking-to-running transition. // This presumably fixes injection mode change for cranking-to-running transition.
// 'isSimultanious' flag should be updated for events if injection modes differ for cranking and running. // 'isSimultanious' flag should be updated for events if injection modes differ for cranking and running.
if (state != oldState) { if (state != oldState) {
engine->injectionEvents.resetOverlapping();
engine->injectionEvents.addFuelEvents(PASS_ENGINE_PARAMETER_SIGNATURE); engine->injectionEvents.addFuelEvents(PASS_ENGINE_PARAMETER_SIGNATURE);
} }
#endif #endif

View File

@ -117,6 +117,12 @@ void FuelSchedule::clear() {
isReady = false; isReady = false;
} }
void FuelSchedule::resetOverlapping() {
for (size_t i = 0; i < efi::size(enginePins.injectors); i++) {
enginePins.injectors[i].reset();
}
}
/** /**
* @returns false in case of error, true if success * @returns false in case of error, true if success
*/ */