diff --git a/firmware/controllers/trigger/trigger_central.cpp b/firmware/controllers/trigger/trigger_central.cpp index 18cae9ddb6..e5abbf34ab 100644 --- a/firmware/controllers/trigger/trigger_central.cpp +++ b/firmware/controllers/trigger/trigger_central.cpp @@ -526,11 +526,20 @@ void resetMaxValues() { #endif /* EFI_PROD_CODE */ } +#if HAL_USE_ICU == TRUE +extern int icuWidthCallbackCounter; +extern int icuWidthPeriodCounter; +#endif /* HAL_USE_ICU */ + void triggerInfo(void) { #if EFI_PROD_CODE || EFI_SIMULATOR TriggerShape *ts = &engine->triggerCentral.triggerShape; +#if HAL_USE_ICU == TRUE + scheduleMsg(logger, "trigger ICU hw: %d %d", icuWidthCallbackCounter, icuWidthPeriodCounter); +#endif /* HAL_USE_ICU */ + scheduleMsg(logger, "Template %s (%d) trigger %s (%d) useRiseEdge=%s onlyFront=%s useOnlyFirstChannel=%s tdcOffset=%.2f", getConfigurationName(engineConfiguration->engineType), engineConfiguration->engineType, getTrigger_type_e(engineConfiguration->trigger.type), engineConfiguration->trigger.type, @@ -707,7 +716,7 @@ void initTriggerCentral(Logging *sharedLogger) { #endif /* EFI_ENGINE_SNIFFER */ #if EFI_PROD_CODE || EFI_SIMULATOR - addConsoleAction("triggerinfo", triggerInfo); + addConsoleAction(CMD_TRIGGERINFO, triggerInfo); addConsoleAction("trigger_shape_info", triggerShapeInfo); addConsoleAction("reset_trigger", resetRunningTriggerCounters); #endif diff --git a/firmware/hw_layer/trigger_input.cpp b/firmware/hw_layer/trigger_input.cpp index bc7dfac6e2..393e77ffbc 100644 --- a/firmware/hw_layer/trigger_input.cpp +++ b/firmware/hw_layer/trigger_input.cpp @@ -18,6 +18,8 @@ #define HAL_TRIGGER_USE_PAL FALSE #endif /* HAL_TRIGGER_USE_PAL */ +volatile int icuWidthCallbackCounter = 0; +volatile int icuWidthPeriodCounter = 0; #if EFI_SHAFT_POSITION_INPUT && (HAL_TRIGGER_USE_PAL == TRUE || HAL_USE_ICU == TRUE) && (HAL_USE_COMP == FALSE) @@ -130,6 +132,7 @@ static void cam_icu_period_callback(ICUDriver *icup) { * 'width' events happens before the 'period' event */ static void shaft_icu_width_callback(ICUDriver *icup) { + icuWidthCallbackCounter++; // todo: support for 3rd trigger input channel // todo: start using real event time from HW event, not just software timer? if (hasFirmwareErrorFlag) @@ -146,6 +149,7 @@ static void shaft_icu_width_callback(ICUDriver *icup) { } static void shaft_icu_period_callback(ICUDriver *icup) { + icuWidthPeriodCounter++; if (hasFirmwareErrorFlag) return; int isPrimary = icup == primaryCrankDriver; diff --git a/java_console/autotest/src/com/rusefi/AutoTest.java b/java_console/autotest/src/com/rusefi/AutoTest.java index 94410e7ddb..9da21f1fe1 100644 --- a/java_console/autotest/src/com/rusefi/AutoTest.java +++ b/java_console/autotest/src/com/rusefi/AutoTest.java @@ -1,6 +1,7 @@ package com.rusefi; +import com.rusefi.config.generated.Fields; import com.rusefi.core.MessagesCentral; import com.rusefi.core.Sensor; import com.rusefi.core.SensorCentral; @@ -135,6 +136,7 @@ public class AutoTest { setEngineType(28); String msg = "mazda 626 default cranking"; IoUtil.changeRpm(200); + sendCommand(Fields.CMD_TRIGGERINFO); EngineChart chart; chart = nextChart();