From 9b4333bb8801b4aa3c4f6b878f82f64efde731a5 Mon Sep 17 00:00:00 2001 From: rusefi Date: Tue, 25 Jul 2017 20:37:46 -0400 Subject: [PATCH] FSIO-based timing correction --- firmware/controllers/algo/engine.cpp | 1 + firmware/controllers/algo/engine.h | 2 ++ firmware/controllers/core/fsio_impl.cpp | 3 +++ 3 files changed, 6 insertions(+) diff --git a/firmware/controllers/algo/engine.cpp b/firmware/controllers/algo/engine.cpp index 0e97a8abf4..4890798fc3 100644 --- a/firmware/controllers/algo/engine.cpp +++ b/firmware/controllers/algo/engine.cpp @@ -106,6 +106,7 @@ void Engine::reset() { withError = isEngineChartEnabled = false; sensorChartMode = SC_OFF; actualLastInjection = 0; + fsioTimingAdjustment = 0; isAlternatorControlEnabled = false; callFromPitStopEndTime = 0; wallFuelCorrection = 0; diff --git a/firmware/controllers/algo/engine.h b/firmware/controllers/algo/engine.h index 56e53b67b1..1bbe248b31 100644 --- a/firmware/controllers/algo/engine.h +++ b/firmware/controllers/algo/engine.h @@ -347,6 +347,8 @@ public: bool isRunningPwmTest; + float fsioTimingAdjustment; + /** * Are we experiencing knock right now? */ diff --git a/firmware/controllers/core/fsio_impl.cpp b/firmware/controllers/core/fsio_impl.cpp index 8cb4a9ba54..a68c8d271c 100644 --- a/firmware/controllers/core/fsio_impl.cpp +++ b/firmware/controllers/core/fsio_impl.cpp @@ -400,6 +400,9 @@ void runFsio(void) { if (boardConfiguration->fanPin != GPIO_UNASSIGNED) { setPinState("fan", &enginePins.fanRelay, radiatorFanLogic); } + if (engineConfiguration->useFSIO16ForTimingAdjustment) { + + } }