Merge remote-tracking branch 'upstream/master' into reset-overlap

This commit is contained in:
Matthew Kennedy 2020-07-20 18:43:17 -07:00
commit ef590b9e7c
3 changed files with 17 additions and 32 deletions

View File

@ -1,2 +1,2 @@
#pragma once #pragma once
#define VCS_DATE 20200720 #define VCS_DATE 20200721

View File

@ -71,15 +71,12 @@ static Logging *logger;
//#endif //#endif
void startSimultaniousInjection(Engine *engine) { void startSimultaniousInjection(Engine *engine) {
#if EFI_TOOTH_LOGGER
efitick_t nowNt = getTimeNowNt();
#if EFI_UNIT_TEST #if EFI_UNIT_TEST
EXPAND_Engine; EXPAND_Engine;
#endif // EFI_UNIT_TEST #endif // EFI_UNIT_TEST
LogTriggerInjectorState(nowNt, true PASS_ENGINE_PARAMETER_SUFFIX); efitick_t nowNt = getTimeNowNt();
#endif // EFI_TOOTH_LOGGER
for (int i = 0; i < engine->engineConfigurationPtr->specs.cylindersCount; i++) { for (int i = 0; i < engine->engineConfigurationPtr->specs.cylindersCount; i++) {
enginePins.injectors[i].open(); enginePins.injectors[i].open(nowNt PASS_ENGINE_PARAMETER_SUFFIX);
} }
} }
@ -87,13 +84,9 @@ static void endSimultaniousInjectionOnlyTogglePins(Engine *engine) {
#if EFI_UNIT_TEST #if EFI_UNIT_TEST
EXPAND_Engine; EXPAND_Engine;
#endif #endif
#if EFI_TOOTH_LOGGER
efitick_t nowNt = getTimeNowNt(); efitick_t nowNt = getTimeNowNt();
LogTriggerInjectorState(nowNt, false PASS_ENGINE_PARAMETER_SUFFIX);
#endif // EFI_TOOTH_LOGGER
for (int i = 0; i < engine->engineConfigurationPtr->specs.cylindersCount; i++) { for (int i = 0; i < engine->engineConfigurationPtr->specs.cylindersCount; i++) {
enginePins.injectors[i].close(); enginePins.injectors[i].close(nowNt PASS_ENGINE_PARAMETER_SUFFIX);
} }
} }
@ -103,16 +96,11 @@ void endSimultaniousInjection(InjectionEvent *event) {
EXPAND_Engine; EXPAND_Engine;
#endif #endif
event->isScheduled = false; event->isScheduled = false;
#if EFI_TOOTH_LOGGER
efitick_t nowNt = getTimeNowNt();
LogTriggerInjectorState(nowNt, false PASS_ENGINE_PARAMETER_SUFFIX);
#endif // EFI_TOOTH_LOGGER
endSimultaniousInjectionOnlyTogglePins(engine); endSimultaniousInjectionOnlyTogglePins(engine);
engine->injectionEvents.addFuelEventsForCylinder(event->ownIndex PASS_ENGINE_PARAMETER_SUFFIX); engine->injectionEvents.addFuelEventsForCylinder(event->ownIndex PASS_ENGINE_PARAMETER_SUFFIX);
} }
void InjectorOutputPin::open() { void InjectorOutputPin::open(efitick_t nowNt DECLARE_ENGINE_PARAMETER_SUFFIX) {
overlappingCounter++; overlappingCounter++;
#if FUEL_MATH_EXTREME_LOGGING #if FUEL_MATH_EXTREME_LOGGING
@ -132,31 +120,29 @@ void InjectorOutputPin::open() {
} }
#endif /* FUEL_MATH_EXTREME_LOGGING */ #endif /* FUEL_MATH_EXTREME_LOGGING */
} else { } else {
#if EFI_TOOTH_LOGGER
LogTriggerInjectorState(nowNt, true PASS_ENGINE_PARAMETER_SUFFIX);
#endif // EFI_TOOTH_LOGGER
setHigh(); setHigh();
} }
} }
void turnInjectionPinHigh(InjectionEvent *event) { void turnInjectionPinHigh(InjectionEvent *event) {
#if EFI_TOOTH_LOGGER
efitick_t nowNt = getTimeNowNt();
#if EFI_UNIT_TEST #if EFI_UNIT_TEST
Engine *engine = event->engine; Engine *engine = event->engine;
EXPAND_Engine; EXPAND_Engine;
#endif // EFI_UNIT_TEST #endif // EFI_UNIT_TEST
LogTriggerInjectorState(nowNt, true PASS_ENGINE_PARAMETER_SUFFIX); efitick_t nowNt = getTimeNowNt();
#endif // EFI_TOOTH_LOGGER
for (int i = 0;i < MAX_WIRES_COUNT;i++) { for (int i = 0;i < MAX_WIRES_COUNT;i++) {
InjectorOutputPin *output = event->outputs[i]; InjectorOutputPin *output = event->outputs[i];
if (output) { if (output) {
output->open(); output->open(nowNt PASS_ENGINE_PARAMETER_SUFFIX);
} }
} }
} }
void InjectorOutputPin::close() { void InjectorOutputPin::close(efitick_t nowNt DECLARE_ENGINE_PARAMETER_SUFFIX) {
#if FUEL_MATH_EXTREME_LOGGING #if FUEL_MATH_EXTREME_LOGGING
if (printFuelDebug) { if (printFuelDebug) {
printf("InjectorOutputPin::close %s %d %d\r\n", name, overlappingCounter, (int)getTimeNowUs()); printf("InjectorOutputPin::close %s %d %d\r\n", name, overlappingCounter, (int)getTimeNowUs());
@ -171,6 +157,9 @@ void InjectorOutputPin::close() {
} }
#endif /* FUEL_MATH_EXTREME_LOGGING */ #endif /* FUEL_MATH_EXTREME_LOGGING */
} else { } else {
#if EFI_TOOTH_LOGGER
LogTriggerInjectorState(nowNt, false PASS_ENGINE_PARAMETER_SUFFIX);
#endif // EFI_TOOTH_LOGGER
setLow(); setLow();
} }
@ -188,15 +177,11 @@ void turnInjectionPinLow(InjectionEvent *event) {
EXPAND_Engine; EXPAND_Engine;
#endif #endif
#if EFI_TOOTH_LOGGER
LogTriggerInjectorState(nowNt, false PASS_ENGINE_PARAMETER_SUFFIX);
#endif // EFI_TOOTH_LOGGER
event->isScheduled = false; event->isScheduled = false;
for (int i = 0;i<MAX_WIRES_COUNT;i++) { for (int i = 0;i<MAX_WIRES_COUNT;i++) {
InjectorOutputPin *output = event->outputs[i]; InjectorOutputPin *output = event->outputs[i];
if (output) { if (output) {
output->close(); output->close(nowNt PASS_ENGINE_PARAMETER_SUFFIX);
} }
} }
ENGINE(injectionEvents.addFuelEventsForCylinder(event->ownIndex PASS_ENGINE_PARAMETER_SUFFIX)); ENGINE(injectionEvents.addFuelEventsForCylinder(event->ownIndex PASS_ENGINE_PARAMETER_SUFFIX));

View File

@ -108,8 +108,8 @@ public:
InjectorOutputPin(); InjectorOutputPin();
void reset(); void reset();
void open(); void open(efitick_t nowNt DECLARE_ENGINE_PARAMETER_SUFFIX);
void close(); void close(efitick_t nowNt DECLARE_ENGINE_PARAMETER_SUFFIX);
int8_t getOverlappingCounter() const { return overlappingCounter; } int8_t getOverlappingCounter() const { return overlappingCounter; }