unit test framework improvements for smoother event execution
This commit is contained in:
parent
241276248b
commit
c34a0d95d7
|
@ -71,12 +71,27 @@ 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
|
||||||
|
EXPAND_Engine;
|
||||||
|
#endif // EFI_UNIT_TEST
|
||||||
|
LogTriggerInjectorState(nowNt, true 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].open();
|
enginePins.injectors[i].open();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void endSimultaniousInjectionOnlyTogglePins(Engine *engine) {
|
static void endSimultaniousInjectionOnlyTogglePins(Engine *engine) {
|
||||||
|
#if EFI_UNIT_TEST
|
||||||
|
EXPAND_Engine;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if EFI_TOOTH_LOGGER
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
@ -88,6 +103,10 @@ 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);
|
||||||
|
@ -98,7 +117,7 @@ void InjectorOutputPin::open() {
|
||||||
|
|
||||||
#if FUEL_MATH_EXTREME_LOGGING
|
#if FUEL_MATH_EXTREME_LOGGING
|
||||||
if (printFuelDebug) {
|
if (printFuelDebug) {
|
||||||
printf("turnInjectionPinHigh %s %d %d\r\n", name, overlappingCounter, (int)getTimeNowUs());
|
printf("InjectorOutputPin::open %s %d now=%0.1fms\r\n", name, overlappingCounter, (int)getTimeNowUs() / 1000.0);
|
||||||
}
|
}
|
||||||
#endif /* FUEL_MATH_EXTREME_LOGGING */
|
#endif /* FUEL_MATH_EXTREME_LOGGING */
|
||||||
|
|
||||||
|
@ -118,9 +137,9 @@ void InjectorOutputPin::open() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void turnInjectionPinHigh(InjectionEvent *event) {
|
void turnInjectionPinHigh(InjectionEvent *event) {
|
||||||
efitick_t nowNt = getTimeNowNt();
|
|
||||||
|
|
||||||
#if EFI_TOOTH_LOGGER
|
#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;
|
||||||
|
@ -164,7 +183,7 @@ void turnInjectionPinLow(InjectionEvent *event) {
|
||||||
EXPAND_Engine;
|
EXPAND_Engine;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if EFI_TOOTH_LOGGER
|
#if EFI_TOOTH_LOGGER
|
||||||
LogTriggerInjectorState(nowNt, false PASS_ENGINE_PARAMETER_SUFFIX);
|
LogTriggerInjectorState(nowNt, false PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
#endif // EFI_TOOTH_LOGGER
|
#endif // EFI_TOOTH_LOGGER
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue