From 25364d30232aae63d4b73b702fa06ac188e8b98e Mon Sep 17 00:00:00 2001 From: rusefi Date: Sat, 3 Feb 2018 13:08:11 -0500 Subject: [PATCH] reducing the coupling between trigger handling and trigger emulation --- firmware/controllers/trigger/trigger_central.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/firmware/controllers/trigger/trigger_central.cpp b/firmware/controllers/trigger/trigger_central.cpp index 74d74c4e8e..68bb51af87 100644 --- a/firmware/controllers/trigger/trigger_central.cpp +++ b/firmware/controllers/trigger/trigger_central.cpp @@ -555,7 +555,7 @@ static void resetRunningTriggerCounters() { #define COMPARE_CONFIG_PARAMS(param) (engineConfiguration->param != previousConfiguration->param) void onConfigurationChangeTriggerCallback(engine_configuration_s *previousConfiguration DECLARE_ENGINE_PARAMETER_SUFFIX) { - bool changedNow = COMPARE_CONFIG_PARAMS(trigger.type) || + bool changed = COMPARE_CONFIG_PARAMS(trigger.type) || COMPARE_CONFIG_PARAMS(operationMode) || COMPARE_CONFIG_PARAMS(useOnlyRisingEdgeForTrigger) || COMPARE_CONFIG_PARAMS(globalTriggerAngleOffset) || @@ -572,7 +572,10 @@ void onConfigurationChangeTriggerCallback(engine_configuration_s *previousConfig COMPARE_CONFIG_PARAMS(bc.nb2ratioFrom) || COMPARE_CONFIG_PARAMS(bc.nb2ratioTo) || COMPARE_CONFIG_PARAMS(nbVvtIndex); - isTriggerConfigChanged = isTriggerConfigChanged || changedNow; + if (changed) { + refreshTriggerShape(logger PASS_ENGINE_PARAMETER_SUFFIX); + } + isTriggerConfigChanged = isTriggerConfigChanged || changed; } /**