diff --git a/firmware/.cproject b/firmware/.cproject
index 99f4a0717d..0ae3f020ff 100644
--- a/firmware/.cproject
+++ b/firmware/.cproject
@@ -181,7 +181,7 @@
diff --git a/firmware/controllers/algo/engine.cpp b/firmware/controllers/algo/engine.cpp
index b17b403c9c..05fda36460 100644
--- a/firmware/controllers/algo/engine.cpp
+++ b/firmware/controllers/algo/engine.cpp
@@ -68,6 +68,9 @@ Engine::Engine(persistent_config_s *config) {
engineState.iat = engineState.clt = NAN;
memset(&ignitionPin, 0, sizeof(ignitionPin));
+ knockNow = false;
+ knockEver = false;
+
iat.config = NULL;
iat.channel = EFI_ADC_NONE;
diff --git a/firmware/controllers/algo/engine.h b/firmware/controllers/algo/engine.h
index b8dea7c37b..3c6ef6e34d 100644
--- a/firmware/controllers/algo/engine.h
+++ b/firmware/controllers/algo/engine.h
@@ -151,6 +151,9 @@ public:
bool_t isRunningPwmTest;
+ bool_t knockNow;
+ bool_t knockEver;
+
/**
* are we running any kind of functional test? this affect
* some areas
diff --git a/firmware/controllers/trigger/main_trigger_callback.cpp b/firmware/controllers/trigger/main_trigger_callback.cpp
index 9f0df913ce..a43fd6ab40 100644
--- a/firmware/controllers/trigger/main_trigger_callback.cpp
+++ b/firmware/controllers/trigger/main_trigger_callback.cpp
@@ -339,6 +339,14 @@ void mainTriggerCallback(trigger_event_e ckpSignalType, uint32_t eventIndex DECL
}
if (eventIndex == engineConfiguration->ignMathCalculateAtIndex) {
+ if (engineConfiguration->externalKnockSenseAdc != EFI_ADC_NONE) {
+ float externalKnockValue = getAdcValue(engineConfiguration->externalKnockSenseAdc);
+ engine->knockNow = externalKnockValue > 2.5;
+
+
+ }
+
+
engine->m.beforeIgnitionMath = GET_TIMESTAMP();
ignitionCalc(rpm PASS_ENGINE_PARAMETER);
engine->m.ignitionMathTime = GET_TIMESTAMP() - engine->m.beforeIgnitionMath;
diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp
index 1c9d66b250..d3aef8bc64 100644
--- a/firmware/rusefi.cpp
+++ b/firmware/rusefi.cpp
@@ -276,5 +276,5 @@ int getRusEfiVersion(void) {
return 1; // this is here to make the compiler happy about the unused array
if (UNUSED_CCM_SIZE[0] == 0)
return 1; // this is here to make the compiler happy about the unused array
- return 20150315;
+ return 20150316;
}