From 110f76d85b791249e87888da939b789fddf0bf30 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Tue, 16 Jan 2018 12:58:35 -0500 Subject: [PATCH] avoiding AFR warning --- firmware/console/status_loop.cpp | 4 +++- firmware/controllers/algo/engine.cpp | 5 +++-- firmware/rusefi.cpp | 2 +- firmware/svnversion.h | 4 ++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index 59af0fcf8c..60b0910d4c 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -701,7 +701,9 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ tsOutputChannels->currentTargetAfr = afrMap.getValue(rpm, mapValue); tsOutputChannels->manifoldAirPressure = mapValue; } - tsOutputChannels->airFuelRatio = getAfr(PASS_ENGINE_PARAMETER_SIGNATURE); + if (hasAfrSensor(PASS_ENGINE_PARAMETER_SIGNATURE)) { + tsOutputChannels->airFuelRatio = getAfr(PASS_ENGINE_PARAMETER_SIGNATURE); + } if (hasVBatt(PASS_ENGINE_PARAMETER_SIGNATURE)) { tsOutputChannels->vBatt = getVBatt(PASS_ENGINE_PARAMETER_SIGNATURE); } diff --git a/firmware/controllers/algo/engine.cpp b/firmware/controllers/algo/engine.cpp index f8ec9fb481..3762ac9b22 100644 --- a/firmware/controllers/algo/engine.cpp +++ b/firmware/controllers/algo/engine.cpp @@ -229,7 +229,9 @@ void EngineState::periodicFastCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) { int rpm = GET_RPM(); sparkDwell = getSparkDwell(rpm PASS_ENGINE_PARAMETER_SUFFIX); dwellAngle = sparkDwell / getOneDegreeTimeMs(rpm); - engine->sensors.currentAfr = getAfr(PASS_ENGINE_PARAMETER_SIGNATURE); + if (hasAfrSensor(PASS_ENGINE_PARAMETER_SIGNATURE)) { + engine->sensors.currentAfr = getAfr(PASS_ENGINE_PARAMETER_SIGNATURE); + } // todo: move this into slow callback, no reason for IAT corr to be here iatFuelCorrection = getIatFuelCorrection(engine->sensors.iat PASS_ENGINE_PARAMETER_SUFFIX); @@ -433,7 +435,6 @@ bool Engine::isInShutdownMode() { } injection_mode_e Engine::getCurrentInjectionMode(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - int rpm = rpmCalculator.rpmValue; return rpmCalculator.isCranking(PASS_ENGINE_PARAMETER_SIGNATURE) ? CONFIG(crankingInjectionMode) : CONFIG(injectionMode); } diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index e843d1f782..d3fdbe45ff 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -263,5 +263,5 @@ int getRusEfiVersion(void) { if (initBootloader() != 0) return 123; #endif /* EFI_BOOTLOADER_INCLUDE_CODE */ - return 20180107; + return 20180116; } diff --git a/firmware/svnversion.h b/firmware/svnversion.h index 700d1ea29e..65bb7be2c9 100644 --- a/firmware/svnversion.h +++ b/firmware/svnversion.h @@ -1,5 +1,5 @@ // This file was generated by Version2Header -// Sun Jan 07 12:10:11 EST 2018 +// Tue Jan 16 12:58:17 EST 2018 #ifndef VCS_VERSION -#define VCS_VERSION "14952" +#define VCS_VERSION "14975" #endif