From 464313a88c0ee9be169fe8dc54affe3ba650bc1c Mon Sep 17 00:00:00 2001 From: rusEfi Date: Wed, 10 Dec 2014 08:03:23 -0600 Subject: [PATCH] auto-sync --- .../controllers/algo/engine_configuration.cpp | 26 +++++++++---------- .../controllers/algo/engine_configuration.h | 1 + firmware/rusefi.cpp | 2 +- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index 7d8689b12d..ffcced45a4 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -77,22 +77,20 @@ void setConstantDwell(engine_configuration_s *engineConfiguration, float dwellMs } } -void setWholeVEMap(engine_configuration_s *engineConfiguration, float value) { - // todo: table helper? -// for (int l = 0; l < VE_LOAD_COUNT; l++) { -// for (int r = 0; r < VE_RPM_COUNT; r++) { -// engineConfiguration->veTable[l][r] = value; -// } -// } +void setMap(fuel_table_t table, float value) { + for (int l = 0; l < FUEL_LOAD_COUNT; l++) { + for (int r = 0; r < FUEL_RPM_COUNT; r++) { + table[l][r] = value; + } + } +} + +static void setWholeVEMap(engine_configuration_s *engineConfiguration, float value) { + setMap(engineConfiguration->veTable, value); } void setWholeFuelMap(engine_configuration_s *engineConfiguration, float value) { - // todo: table helper? - for (int l = 0; l < FUEL_LOAD_COUNT; l++) { - for (int r = 0; r < FUEL_RPM_COUNT; r++) { - engineConfiguration->fuelTable[l][r] = value; - } - } + setMap(engineConfiguration->fuelTable, value); } void setWholeTimingTable(engine_configuration_s *engineConfiguration, float value) { @@ -164,6 +162,8 @@ void setDefaultConfiguration(engine_configuration_s *engineConfiguration, board_ // set_whole_timing_map 3 setWholeFuelMap(engineConfiguration, 3); + setWholeVEMap(engineConfiguration, 0.8); + setMap(engineConfiguration->afrTable, 14.7); setThermistorConfiguration(&engineConfiguration->cltThermistorConf, 0, 9500, 23.8889, 2100, 48.8889, 1000); engineConfiguration->cltThermistorConf.bias_resistor = 1500; diff --git a/firmware/controllers/algo/engine_configuration.h b/firmware/controllers/algo/engine_configuration.h index a9c1e5164f..b14b7a6a22 100644 --- a/firmware/controllers/algo/engine_configuration.h +++ b/firmware/controllers/algo/engine_configuration.h @@ -552,6 +552,7 @@ extern "C" { #endif /* __cplusplus */ void setDefaultConfiguration(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration); +void setMap(fuel_table_t table, float value); void setWholeFuelMap(engine_configuration_s *engineConfiguration, float value); void setWholeTimingTable(engine_configuration_s *engineConfiguration, float value); void setConstantDwell(engine_configuration_s *engineConfiguration, float dwellMs); diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index 0b3a2e1cde..6e3b63b079 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -265,5 +265,5 @@ int getRusEfiVersion(void) { return 1; // this is here to make the compiler happy about the unused array if (UNUSED_CCM_SIZE == 0) return 1; // this is here to make the compiler happy about the unused array - return 20141209; + return 20141210; }