better unit test logging

This commit is contained in:
rusefi 2020-07-19 14:13:15 -04:00
parent 46a1d361b5
commit 5a10e8adac
1 changed files with 18 additions and 8 deletions

View File

@ -24,6 +24,10 @@
#include "global.h"
#include "os_access.h"
#if EFI_PRINTF_FUEL_DETAILS
bool printFuelDebug = false;
#endif
#if EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT
#include "main_trigger_callback.h"
@ -188,7 +192,9 @@ void handleFuelInjectionEvent(int injEventIndex, InjectionEvent *event,
size_t injectorIndex = event->outputs[0]->injectorIndex;
const floatms_t injectionDuration = ENGINE(wallFuel[injectorIndex]).adjust(ENGINE(injectionDuration) PASS_ENGINE_PARAMETER_SUFFIX);
#if EFI_PRINTF_FUEL_DETAILS
printf("fuel injectionDuration=%.2f adjusted=%.2f\t\n", ENGINE(injectionDuration), injectionDuration);
if (printFuelDebug) {
printf("fuel injectionDuration=%.2f adjusted=%.2f\t\n", ENGINE(injectionDuration), injectionDuration);
}
#endif /*EFI_PRINTF_FUEL_DETAILS */
bool isCranking = ENGINE(rpmCalculator).isCranking(PASS_ENGINE_PARAMETER_SIGNATURE);
@ -238,16 +244,20 @@ void handleFuelInjectionEvent(int injEventIndex, InjectionEvent *event,
prevOutputName = outputName;
}
#if EFI_UNIT_TEST || EFI_SIMULATOR || EFI_PRINTF_FUEL_DETAILS
InjectorOutputPin *output = event->outputs[0];
printf("fuelout %s duration %d total=%d\t\n", output->name, (int)durationUs,
(int)MS2US(getCrankshaftRevolutionTimeMs(GET_RPM_VALUE)));
#if EFI_PRINTF_FUEL_DETAILS
if (printFuelDebug) {
InjectorOutputPin *output = event->outputs[0];
printf("handleFuelInjectionEvent fuelout %s duration %d total=%d\t\n", output->name, (int)durationUs,
(int)MS2US(getCrankshaftRevolutionTimeMs(GET_RPM_VALUE)));
}
#endif /*EFI_PRINTF_FUEL_DETAILS */
if (event->isScheduled) {
#if EFI_UNIT_TEST || EFI_SIMULATOR
printf("still used1 %s %d\r\n", output->name, (int)getTimeNowUs());
#endif /* EFI_UNIT_TEST || EFI_SIMULATOR */
#if EFI_PRINTF_FUEL_DETAILS
if (printFuelDebug) {
printf("handleFuelInjectionEvent still used1 %s %d\r\n", output->name, (int)getTimeNowUs());
}
#endif /*EFI_PRINTF_FUEL_DETAILS */
return; // this InjectionEvent is still needed for an extremely long injection scheduled previously
}