logicdata into unit tests

This commit is contained in:
rusefi 2020-07-19 22:03:30 -04:00
parent e7b86346e8
commit f37e739438
2 changed files with 20 additions and 10 deletions

View File

@ -117,6 +117,10 @@ void turnInjectionPinHigh(InjectionEvent *event) {
efitick_t nowNt = getTimeNowNt();
#if EFI_TOOTH_LOGGER
#if EFI_UNIT_TEST
Engine *engine = event->engine;
EXPAND_Engine;
#endif // EFI_UNIT_TEST
LogTriggerInjectorState(nowNt, true PASS_ENGINE_PARAMETER_SUFFIX);
#endif // EFI_TOOTH_LOGGER
@ -131,7 +135,7 @@ void turnInjectionPinHigh(InjectionEvent *event) {
void InjectorOutputPin::close() {
#if FUEL_MATH_EXTREME_LOGGING
printf("turnInjectionPinLow %s %d %d\r\n", name, overlappingCounter, (int)getTimeNowUs());
printf("InjectorOutputPin::close %s %d %d\r\n", name, overlappingCounter, (int)getTimeNowUs());
#endif /* FUEL_MATH_EXTREME_LOGGING */
overlappingCounter--;
@ -147,7 +151,12 @@ void InjectorOutputPin::close() {
void turnInjectionPinLow(InjectionEvent *event) {
efitick_t nowNt = getTimeNowNt();
#if EFI_TOOTH_LOGGER
#if EFI_UNIT_TEST
Engine *engine = event->engine;
EXPAND_Engine;
#endif
#if EFI_TOOTH_LOGGER
LogTriggerInjectorState(nowNt, false PASS_ENGINE_PARAMETER_SUFFIX);
#endif // EFI_TOOTH_LOGGER
@ -158,10 +167,6 @@ void turnInjectionPinLow(InjectionEvent *event) {
output->close();
}
}
#if EFI_UNIT_TEST
Engine *engine = event->engine;
EXPAND_Engine;
#endif
ENGINE(injectionEvents.addFuelEventsForCylinder(event->ownIndex PASS_ENGINE_PARAMETER_SUFFIX));
}

View File

@ -127,6 +127,11 @@ static void prepareCylinderIgnitionSchedule(angle_t dwellAngleDuration, floatms_
void fireSparkAndPrepareNextSchedule(IgnitionEvent *event) {
efitick_t nowNt = getTimeNowNt();
#if EFI_UNIT_TEST
Engine *engine = event->engine;
EXPAND_Engine;
#endif // EFI_UNIT_TEST
#if EFI_TOOTH_LOGGER
LogTriggerCoilState(nowNt, false PASS_ENGINE_PARAMETER_SUFFIX);
#endif // EFI_TOOTH_LOGGER
@ -165,10 +170,6 @@ if (engineConfiguration->debugMode == DBG_DWELL_METRIC) {
#endif
}
#endif /* EFI_UNIT_TEST */
#if EFI_UNIT_TEST
Engine *engine = event->engine;
EXPAND_Engine;
#endif /* EFI_UNIT_TEST */
// now that we've just fired a coil let's prepare the new schedule for the next engine revolution
@ -246,6 +247,10 @@ void turnSparkPinHigh(IgnitionEvent *event) {
efitick_t nowNt = getTimeNowNt();
#if EFI_TOOTH_LOGGER
#if EFI_UNIT_TEST
Engine *engine = event->engine;
EXPAND_Engine;
#endif // EFI_UNIT_TEST
LogTriggerCoilState(nowNt, true PASS_ENGINE_PARAMETER_SUFFIX);
#endif // EFI_TOOTH_LOGGER