From 26f85c4e11e8529d7ad87d5ec4f1b3dc23baff6f Mon Sep 17 00:00:00 2001 From: rusefi Date: Sun, 19 Jul 2020 14:58:46 -0400 Subject: [PATCH] better unit test logging --- firmware/controllers/math/speed_density.cpp | 2 +- .../system/timer/signal_executor_sleep.cpp | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/firmware/controllers/math/speed_density.cpp b/firmware/controllers/math/speed_density.cpp index 1efbf8f304..9518586ec5 100644 --- a/firmware/controllers/math/speed_density.cpp +++ b/firmware/controllers/math/speed_density.cpp @@ -155,7 +155,7 @@ AirmassResult getSpeedDensityAirmass(float map DECLARE_ENGINE_PARAMETER_SUFFIX) return {}; } #if EFI_PRINTF_FUEL_DETAILS - printf("map=%.2f adjustedMap=%.2f airMass=%.2f\t\n", + printf("getSpeedDensityAirmass map=%.2f adjustedMap=%.2f airMass=%.2f\t\n", map, adjustedMap, engine->engineState.sd.adjustedManifoldAirPressure); #endif /*EFI_PRINTF_FUEL_DETAILS */ diff --git a/firmware/controllers/system/timer/signal_executor_sleep.cpp b/firmware/controllers/system/timer/signal_executor_sleep.cpp index 99478fea69..1d236a3537 100644 --- a/firmware/controllers/system/timer/signal_executor_sleep.cpp +++ b/firmware/controllers/system/timer/signal_executor_sleep.cpp @@ -31,6 +31,10 @@ #include "efi_gpio.h" #endif /* EFI_SIMULATOR */ +#if EFI_PRINTF_FUEL_DETAILS +bool printSchedulerDebug = true; +#endif EFI_PRINTF_FUEL_DETAILS + #if EFI_SIGNAL_EXECUTOR_SLEEP void SleepExecutor::scheduleByTimestamp(scheduling_s *scheduling, efitimeus_t timeUs, action_s action) { @@ -43,14 +47,15 @@ void SleepExecutor::scheduleByTimestampNt(scheduling_s* scheduling, efitick_t ti static void timerCallback(scheduling_s *scheduling) { #if EFI_PRINTF_FUEL_DETAILS - if (scheduling->action.getCallback() == (schfunc_t)&turnInjectionPinLow) { - printf("executing cb=turnInjectionPinLow p=%d sch=%d now=%d\r\n", (int)scheduling->action.getArgument(), (int)scheduling, + if (printSchedulerDebug) { + if (scheduling->action.getCallback() == (schfunc_t)&turnInjectionPinLow) { + printf("executing cb=turnInjectionPinLow p=%d sch=%d now=%d\r\n", (int)scheduling->action.getArgument(), (int)scheduling, (int)getTimeNowUs()); - } else { + } else { // printf("exec cb=%d p=%d\r\n", (int)scheduling->callback, (int)scheduling->param); + } } - -#endif /* EFI_SIMULATOR */ +#endif // EFI_PRINTF_FUEL_DETAILS scheduling->action.execute(); }