From 9b287cd0d70c244c10274016e60a601b7f2470aa Mon Sep 17 00:00:00 2001 From: rusefi Date: Mon, 16 Oct 2017 15:07:36 -0400 Subject: [PATCH] #480 --- firmware/hw_layer/trigger_input.cpp | 4 ++-- firmware/rusefi.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/firmware/hw_layer/trigger_input.cpp b/firmware/hw_layer/trigger_input.cpp index f16a18d7ae..b99236f86b 100644 --- a/firmware/hw_layer/trigger_input.cpp +++ b/firmware/hw_layer/trigger_input.cpp @@ -57,7 +57,7 @@ static void shaft_icu_width_callback(ICUDriver *icup) { } // icucnt_t last_width = icuGetWidth(icup); so far we are fine with system time // todo: add support for 3rd channel - trigger_event_e signal = isPrimary ? SHAFT_PRIMARY_RISING : SHAFT_SECONDARY_RISING; + trigger_event_e signal = isPrimary ? (engineConfiguration->invertPrimaryTriggerSignal ? SHAFT_PRIMARY_FALLING : SHAFT_PRIMARY_RISING) : (engineConfiguration->invertSecondaryTriggerSignal ? SHAFT_SECONDARY_FALLING : SHAFT_SECONDARY_RISING); hwHandleShaftSignal(signal); } @@ -73,7 +73,7 @@ static void shaft_icu_period_callback(ICUDriver *icup) { // todo: add support for 3rd channel // icucnt_t last_period = icuGetPeriod(icup); so far we are fine with system time trigger_event_e signal = - isPrimary ? SHAFT_PRIMARY_FALLING : SHAFT_SECONDARY_FALLING; + isPrimary ? (engineConfiguration->invertPrimaryTriggerSignal ? SHAFT_PRIMARY_RISING : SHAFT_PRIMARY_FALLING) : (engineConfiguration->invertSecondaryTriggerSignal ? SHAFT_SECONDARY_RISING : SHAFT_SECONDARY_FALLING); hwHandleShaftSignal(signal); } diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index 76ad60676b..287a3d1e87 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -260,5 +260,5 @@ int getRusEfiVersion(void) { if (initBootloader() != 0) return 123; #endif /* EFI_BOOTLOADER_INCLUDE_CODE */ - return 20170921; + return 20171016; }