From 03a48455ed3df4b28d6b8a19c32dcadaddb0b9f2 Mon Sep 17 00:00:00 2001 From: rusefi Date: Fri, 10 Jan 2020 23:39:30 -0500 Subject: [PATCH] fear he who sees dead code: 'overlappingScheduleOffTime' was never assigned so the whole logic around it is dead --- .../engine_cycle/main_trigger_callback.cpp | 27 ++----------------- firmware/controllers/system/efi_gpio.cpp | 2 -- firmware/controllers/system/efi_gpio.h | 2 -- 3 files changed, 2 insertions(+), 29 deletions(-) diff --git a/firmware/controllers/engine_cycle/main_trigger_callback.cpp b/firmware/controllers/engine_cycle/main_trigger_callback.cpp index 3118989064..1bc1b4bc25 100644 --- a/firmware/controllers/engine_cycle/main_trigger_callback.cpp +++ b/firmware/controllers/engine_cycle/main_trigger_callback.cpp @@ -137,21 +137,6 @@ static inline void turnInjectionPinLow(InjectorOutputPin *output) { printf("turnInjectionPinLow %s %d %d\r\n", output->name, output->overlappingCounter, (int)getTimeNowUs()); #endif /* FUEL_MATH_EXTREME_LOGGING */ - if (output->cancelNextTurningInjectorOff) { - /** - * in case of fuel schedule overlap between engine cycles, - * and if engine cycle is above say 75% for batch mode on 4 cylinders, - * we will get a secondary overlap between the special injection and a normal injection on the same injector. - * In such a case want to combine these two injection into one continues injection. - * Unneeded turn of injector on is handle while scheduling that second injection, but cancellation - * of special injection end has to be taken care of dynamically - * - */ - output->cancelNextTurningInjectorOff = false; -#if EFI_SIMULATOR - printf("was cancelled %s %d\r\n", output->name, (int)getTimeNowUs()); -#endif /* EFI_SIMULATOR */ - } else { #if FUEL_MATH_EXTREME_LOGGING const char * w = output->currentLogicValue == false ? "err" : ""; @@ -168,7 +153,7 @@ static inline void turnInjectionPinLow(InjectorOutputPin *output) { } else { output->setLow(); } - } + } void turnInjectionPinLow(InjectionEvent *event) { @@ -315,16 +300,8 @@ static ALWAYS_INLINE void handleFuelInjectionEvent(int injEventIndex, InjectionE event->isScheduled = true; efitimeus_t turnOnTime = nowUs + (int) injectionStartDelayUs; - bool isSecondaryOverlapping = turnOnTime < output->overlappingScheduleOffTime; - if (isSecondaryOverlapping) { - output->cancelNextTurningInjectorOff = true; - #if EFI_UNIT_TEST || EFI_SIMULATOR - printf("please cancel %s %d %d\r\n", output->name, (int)getTimeNowUs(), output->overlappingCounter); - #endif /* EFI_UNIT_TEST || EFI_SIMULATOR */ - } else { - sescheduleByTimestamp(sUp, turnOnTime, { &turnInjectionPinHigh, event } PASS_ENGINE_PARAMETER_SUFFIX); - } + sescheduleByTimestamp(sUp, turnOnTime, { &turnInjectionPinHigh, event } PASS_ENGINE_PARAMETER_SUFFIX); efitimeus_t turnOffTime = nowUs + (int) (injectionStartDelayUs + durationUs); sescheduleByTimestamp(sDown, turnOffTime, { &turnInjectionPinLow, event } PASS_ENGINE_PARAMETER_SUFFIX); } diff --git a/firmware/controllers/system/efi_gpio.cpp b/firmware/controllers/system/efi_gpio.cpp index b209fed6b4..3104da9bde 100644 --- a/firmware/controllers/system/efi_gpio.cpp +++ b/firmware/controllers/system/efi_gpio.cpp @@ -273,8 +273,6 @@ bool NamedOutputPin::stop() { } void InjectorOutputPin::reset() { - overlappingScheduleOffTime = 0; - cancelNextTurningInjectorOff = false; overlappingCounter = 0; // todo: this could be refactored by calling some super-reset method currentLogicValue = INITIAL_PIN_STATE; diff --git a/firmware/controllers/system/efi_gpio.h b/firmware/controllers/system/efi_gpio.h index d46f55d753..b9defdf43a 100644 --- a/firmware/controllers/system/efi_gpio.h +++ b/firmware/controllers/system/efi_gpio.h @@ -97,10 +97,8 @@ class InjectorOutputPin : public NamedOutputPin { public: InjectorOutputPin(); void reset(); - efitimeus_t overlappingScheduleOffTime; // todo: re-implement this injectorIndex via address manipulation to reduce memory usage? int8_t injectorIndex; - bool cancelNextTurningInjectorOff; int8_t overlappingCounter; };