diff --git a/firmware/controllers/trigger/trigger_decoder.cpp b/firmware/controllers/trigger/trigger_decoder.cpp index 761f359954..11db1a0c75 100644 --- a/firmware/controllers/trigger/trigger_decoder.cpp +++ b/firmware/controllers/trigger/trigger_decoder.cpp @@ -59,6 +59,10 @@ bool printTriggerDebug = false; float actualSynchGap; #endif /* ! EFI_PROD_CODE */ +#if ! EFI_UNIT_TEST || defined(__DOXYGEN__) +extern TunerStudioOutputChannels tsOutputChannels; +#endif /* EFI_UNIT_TEST */ + static Logging * logger; efitick_t lastDecodingErrorTime = US2NT(-10000000LL); @@ -219,6 +223,13 @@ void TriggerState::decodeTriggerEvent(trigger_event_e const signal, efitime_t no if (TRIGGER_SHAPE(isSynchronizationNeeded)) { // this is getting a little out of hand, any ideas? + if (engineConfiguration->debugMode == DGB_TRIGGER_SYNC) { + float currentGap = currentDuration / toothed_previous_duration; +#if ! EFI_UNIT_TEST || defined(__DOXYGEN__) + tsOutputChannels.debugIntField1 = currentGap; +#endif /* EFI_UNIT_TEST */ + } + bool primaryGap = currentDuration > toothed_previous_duration * TRIGGER_SHAPE(syncRatioFrom) && currentDuration < toothed_previous_duration * TRIGGER_SHAPE(syncRatioTo); @@ -309,6 +320,15 @@ void TriggerState::decodeTriggerEvent(trigger_event_e const signal, efitime_t no enginePins.triggerDecoderErrorPin.setValue(isDecodingError); if (isDecodingError && !isInitializingTrigger) { + if (engineConfiguration->debugMode == DGB_TRIGGER_SYNC) { +#if ! EFI_UNIT_TEST || defined(__DOXYGEN__) + + tsOutputChannels.debugIntField1 = currentCycle.eventCount[0]; + tsOutputChannels.debugIntField2 = currentCycle.eventCount[1]; + tsOutputChannels.debugIntField3 = currentCycle.eventCount[2]; +#endif /* EFI_UNIT_TEST */ + } + warning(CUSTOM_SYNC_COUNT_MISMATCH, "trigger not happy current %d/%d/%d expected %d/%d/%d", currentCycle.eventCount[0], currentCycle.eventCount[1], diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index d60be25acf..1ff3a6fd3d 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -251,5 +251,5 @@ int getRusEfiVersion(void) { return 123; // this is here to make the compiler happy about the unused array if (UNUSED_CCM_SIZE[0] * 0 != 0) return 3211; // this is here to make the compiler happy about the unused array - return 20170511; + return 20170512; }