From 65deb8131a3c1649f3ac068cb541a0a01326be59 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Mon, 4 Apr 2016 10:01:43 -0400 Subject: [PATCH] auto-sync --- firmware/controllers/core/fsio_core.cpp | 11 +++++++---- firmware/controllers/core/fsio_impl.cpp | 10 ++++++++++ firmware/controllers/core/fsio_impl.h | 3 +++ firmware/rusefi.cpp | 2 +- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/firmware/controllers/core/fsio_core.cpp b/firmware/controllers/core/fsio_core.cpp index 81fa69b9ee..1d12fcf5b5 100644 --- a/firmware/controllers/core/fsio_core.cpp +++ b/firmware/controllers/core/fsio_core.cpp @@ -20,6 +20,9 @@ #include "fsio_core.h" #include "fsio_impl.h" +extern fsio8_Map3D_t fsioTable1; +extern fsio8_Map3D_t fsioTable2; + LENameOrdinalPair * LE_FIRST = NULL; /** @@ -251,16 +254,16 @@ bool LECalculator::processElement(Engine *engine, LEElement *element) { break; case LE_METHOD_FSIO_TABLE: { float i = pop(LE_METHOD_FSIO_TABLE); - float xValue = pop(LE_METHOD_FSIO_TABLE); float yValue = pop(LE_METHOD_FSIO_TABLE); + float xValue = pop(LE_METHOD_FSIO_TABLE); int index = (int) i; - if (index < 0 || index > 2) { + if (index < 1 || index > 2) { push(element->action, NAN); } else { + fsio8_Map3D_t *t = index == 1 ? &fsioTable1 : &fsioTable2; + push(element->action, t->getValue(xValue, yValue)); } - - } break; case LE_METHOD_KNOCK: diff --git a/firmware/controllers/core/fsio_impl.cpp b/firmware/controllers/core/fsio_impl.cpp index 6d7b99cc26..a235b45ac6 100644 --- a/firmware/controllers/core/fsio_impl.cpp +++ b/firmware/controllers/core/fsio_impl.cpp @@ -17,6 +17,10 @@ #define NO_PWM 0 +fsio8_Map3D_t fsioTable1("fsio#1"); +fsio8_Map3D_t fsioTable2("fsio#2"); + + /** * Here we define all rusEfi-specific methods */ @@ -475,6 +479,12 @@ void initFsioImpl(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S) { addConsoleAction("fsioinfo", showFsioInfo); addConsoleActionSP("eval", (VoidCharPtrVoidPtr) eval, engine); #endif + + fsioTable1.init(config->fsioTable1, config->fsioTable1LoadBins, + config->fsioTable1RpmBins); + fsioTable2.init(config->fsioTable2, config->fsioTable2LoadBins, + config->fsioTable2RpmBins); + } diff --git a/firmware/controllers/core/fsio_impl.h b/firmware/controllers/core/fsio_impl.h index e387659297..de363d5a25 100644 --- a/firmware/controllers/core/fsio_impl.h +++ b/firmware/controllers/core/fsio_impl.h @@ -11,6 +11,9 @@ #include "fsio_core.h" #include "engine.h" +#include "table_helper.h" + +typedef Map3D fsio8_Map3D_t; /** * In human language that's diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index 9b0f80e709..eb7e3da768 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -292,5 +292,5 @@ int getRusEfiVersion(void) { return 123; // this is here to make the compiler happy about the unused array if (UNUSED_CCM_SIZE[0] * 0 != 0) return 3211; // this is here to make the compiler happy about the unused array - return 20160312; + return 20160404; }