From a86ed4b618f2754cbaf0fed2438148ebd185a790 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Fri, 1 Jul 2016 23:01:22 -0400 Subject: [PATCH] auto-sync --- .../controllers/algo/engine_configuration.cpp | 6 +- ...ngine_configuration_generated_structures.h | 58 +++++++++++----- firmware/controllers/algo/nmea.c | 6 +- firmware/controllers/algo/rusefi_generated.h | 48 +++++++------ firmware/controllers/algo/rusefi_types.h | 5 +- firmware/controllers/core/fsio_core.cpp | 4 +- firmware/controllers/core/fsio_impl.cpp | 8 ++- firmware/controllers/core/table_helper.h | 7 +- firmware/controllers/flash_main.h | 2 +- firmware/controllers/math/speed_density.cpp | 2 +- firmware/integration/rusefi.xml | 4 +- firmware/integration/rusefi_config.txt | 19 ++++-- firmware/rusefi.cpp | 2 +- firmware/tunerstudio/rusefi.ini | 49 ++++++++----- .../io/src/com/rusefi/TsPageSize.java | 2 +- .../models/src/com/rusefi/config/Fields.java | 68 +++++++++++-------- java_console/rusefi.xml | 10 +-- 17 files changed, 193 insertions(+), 107 deletions(-) diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index ac9503ae24..5f1ef2a25a 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -134,7 +134,7 @@ void setConstantDwell(floatms_t dwellMs DECLARE_ENGINE_PARAMETER_S) { void setAfrMap(afr_table_t table, float value) { for (int l = 0; l < FUEL_LOAD_COUNT; l++) { for (int rpmIndex = 0; rpmIndex < FUEL_RPM_COUNT; rpmIndex++) { - table[l][rpmIndex] = value; + table[l][rpmIndex] = (int)(value * AFR_STORAGE_MULT); } } } @@ -394,6 +394,10 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) { setRpmTableBin(config->fsioTable1RpmBins, FSIO_TABLE_8); setTableBin2(config->fsioTable2LoadBins, FSIO_TABLE_8, 20, 120, 10); setRpmTableBin(config->fsioTable2RpmBins, FSIO_TABLE_8); + setTableBin2(config->fsioTable3LoadBins, FSIO_TABLE_8, 20, 120, 10); + setRpmTableBin(config->fsioTable3RpmBins, FSIO_TABLE_8); + setTableBin2(config->fsioTable4LoadBins, FSIO_TABLE_8, 20, 120, 10); + setRpmTableBin(config->fsioTable4RpmBins, FSIO_TABLE_8); initEngineNoiseTable(PASS_ENGINE_PARAMETER_F); diff --git a/firmware/controllers/algo/engine_configuration_generated_structures.h b/firmware/controllers/algo/engine_configuration_generated_structures.h index f57795b204..2892563ff5 100644 --- a/firmware/controllers/algo/engine_configuration_generated_structures.h +++ b/firmware/controllers/algo/engine_configuration_generated_structures.h @@ -1,4 +1,4 @@ -// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Fri Jul 01 14:38:02 EDT 2016 +// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Fri Jul 01 17:21:02 EDT 2016 // begin #ifndef ENGINE_CONFIGURATION_GENERATED_H_ #define ENGINE_CONFIGURATION_GENERATED_H_ @@ -1797,55 +1797,81 @@ typedef struct { */ afr_table_t afrTable; /** - * offset 15992 + * offset 15224 */ float afrLoadBins[FUEL_LOAD_COUNT]; /** - * offset 16056 + * offset 15288 */ float afrRpmBins[FUEL_RPM_COUNT]; /** - * offset 16120 + * offset 15352 */ tps_tps_table_t tpsTpsAccelTable; /** - * offset 16376 + * offset 15608 */ float tpsTpsAccelFromRpmBins[TPS_TPS_ACCEL_TABLE]; /** * RPM is float and not integer in order to use unified methods for interpolation - * offset 16408 + * offset 15640 */ float tpsTpsAccelToRpmBins[TPS_TPS_ACCEL_TABLE]; /** - * offset 16440 + * offset 15672 */ - fsio_table_8x8_t fsioTable1; + fsio_table_8x8_f32t fsioTable1; /** - * offset 16696 + * offset 15928 */ float fsioTable1LoadBins[FSIO_TABLE_8]; /** * RPM is float and not integer in order to use unified methods for interpolation - * offset 16728 + * offset 15960 */ float fsioTable1RpmBins[FSIO_TABLE_8]; /** - * offset 16760 + * offset 15992 */ - fsio_table_8x8_t fsioTable2; + fsio_table_8x8_u8t fsioTable2; /** - * offset 17016 + * offset 16056 */ float fsioTable2LoadBins[FSIO_TABLE_8]; /** * RPM is float and not integer in order to use unified methods for interpolation - * offset 17048 + * offset 16088 */ float fsioTable2RpmBins[FSIO_TABLE_8]; - /** total size 17080*/ + /** + * offset 16120 + */ + fsio_table_8x8_u8t fsioTable3; + /** + * offset 16184 + */ + float fsioTable3LoadBins[FSIO_TABLE_8]; + /** + * RPM is float and not integer in order to use unified methods for interpolation + * offset 16216 + */ + float fsioTable3RpmBins[FSIO_TABLE_8]; + /** + * offset 16248 + */ + fsio_table_8x8_u8t fsioTable4; + /** + * offset 16312 + */ + float fsioTable4LoadBins[FSIO_TABLE_8]; + /** + * RPM is float and not integer in order to use unified methods for interpolation + * offset 16344 + */ + float fsioTable4RpmBins[FSIO_TABLE_8]; + /** total size 16376*/ } persistent_config_s; #endif // end -// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Fri Jul 01 14:38:02 EDT 2016 +// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Fri Jul 01 17:21:02 EDT 2016 diff --git a/firmware/controllers/algo/nmea.c b/firmware/controllers/algo/nmea.c index 32b6419d96..4bb3c56949 100644 --- a/firmware/controllers/algo/nmea.c +++ b/firmware/controllers/algo/nmea.c @@ -52,9 +52,9 @@ float gps_deg_dec(float deg_point) { int deg = (int) (ddeg / 100); int min = (int) (deg_point - (deg * 100)); - float absdlat = roundf(deg * 1000000.); - float absmlat = roundf(min * 1000000.); - float absslat = roundf(sec * 1000000.); + float absdlat = round(deg * 1000000.); + float absmlat = round(min * 1000000.); + float absslat = round(sec * 1000000.); return round(absdlat + (absmlat / 60) + (absslat / 3600)) / 1000000; } diff --git a/firmware/controllers/algo/rusefi_generated.h b/firmware/controllers/algo/rusefi_generated.h index b87927f16e..699e41a703 100644 --- a/firmware/controllers/algo/rusefi_generated.h +++ b/firmware/controllers/algo/rusefi_generated.h @@ -837,8 +837,15 @@ #define auxPid1_offset_offset 2424 #define auxPid1_offset_offset_hex 978 #define crankingIdleAdjustment_offset 2428 -#define unused_offset 2432 -#define unused_offset_hex 980 +#define tChargeMinRpmMinTps_offset 2432 +#define tChargeMinRpmMinTps_offset_hex 980 +#define tChargeMinRpmMaxTps_offset 2436 +#define tChargeMinRpmMaxTps_offset_hex 984 +#define tChargeMaxRpmMinTps_offset 2440 +#define tChargeMaxRpmMinTps_offset_hex 988 +#define tChargeMaxRpmMaxTps_offset 2444 +#define unused_offset 2448 +#define unused_offset_hex 990 #define le_formulas1_offset 3048 #define le_formulas2_offset 3248 #define le_formulas3_offset 3448 @@ -898,22 +905,21 @@ #define veLoadBins_offset 14840 #define veRpmBins_offset 14904 #define afrTable_offset 14968 -#define afrLoadBins_offset 15992 -#define afrRpmBins_offset 16056 -#define tpsTpsAccelTable_offset 16120 -#define tpsTpsAccelFromRpmBins_offset 16376 -#define tpsTpsAccelToRpmBins_offset 16408 -#define tpsTpsAccelToRpmBins_offset_hex 4018 -#define fsioTable1_offset 16440 -#define fsioTable1_offset_hex 4038 -#define fsioTable1LoadBins_offset 16696 -#define fsioTable1LoadBins_offset_hex 4138 -#define fsioTable1RpmBins_offset 16728 -#define fsioTable1RpmBins_offset_hex 4158 -#define fsioTable2_offset 16760 -#define fsioTable2_offset_hex 4178 -#define fsioTable2LoadBins_offset 17016 -#define fsioTable2LoadBins_offset_hex 4278 -#define fsioTable2RpmBins_offset 17048 -#define fsioTable2RpmBins_offset_hex 4298 -#define TOTAL_CONFIG_SIZE 17080 +#define afrLoadBins_offset 15224 +#define afrRpmBins_offset 15288 +#define tpsTpsAccelTable_offset 15352 +#define tpsTpsAccelFromRpmBins_offset 15608 +#define tpsTpsAccelToRpmBins_offset 15640 +#define fsioTable1_offset 15672 +#define fsioTable1LoadBins_offset 15928 +#define fsioTable1RpmBins_offset 15960 +#define fsioTable2_offset 15992 +#define fsioTable2LoadBins_offset 16056 +#define fsioTable2RpmBins_offset 16088 +#define fsioTable3_offset 16120 +#define fsioTable3LoadBins_offset 16184 +#define fsioTable3RpmBins_offset 16216 +#define fsioTable4_offset 16248 +#define fsioTable4LoadBins_offset 16312 +#define fsioTable4RpmBins_offset 16344 +#define TOTAL_CONFIG_SIZE 16376 diff --git a/firmware/controllers/algo/rusefi_types.h b/firmware/controllers/algo/rusefi_types.h index b37358a95b..538f2ead3b 100644 --- a/firmware/controllers/algo/rusefi_types.h +++ b/firmware/controllers/algo/rusefi_types.h @@ -54,13 +54,15 @@ typedef char le_formula_t[LE_COMMAND_LENGTH]; typedef brain_pin_e egt_cs_array_t[EGT_CHANNEL_COUNT]; +typedef uint8_t afr_table_t[FUEL_LOAD_COUNT][FUEL_RPM_COUNT]; // todo: merge these two types together? but these tables have different TS parameters like ranges etc typedef float fuel_table_t[FUEL_LOAD_COUNT][FUEL_RPM_COUNT]; typedef float ignition_table_t[IGN_LOAD_COUNT][IGN_RPM_COUNT]; typedef float baro_corr_table_t[BARO_CORR_SIZE][BARO_CORR_SIZE]; -typedef float fsio_table_8x8_t[FSIO_TABLE_8][FSIO_TABLE_8]; +typedef float fsio_table_8x8_f32t[FSIO_TABLE_8][FSIO_TABLE_8]; +typedef uint8_t fsio_table_8x8_u8t[FSIO_TABLE_8][FSIO_TABLE_8]; typedef float tps_tps_table_t[TPS_TPS_ACCEL_TABLE][TPS_TPS_ACCEL_TABLE]; @@ -78,7 +80,6 @@ typedef float fsio_setting_t; typedef brain_pin_e brain_input_pin_e; typedef fuel_table_t ve_table_t; -typedef fuel_table_t afr_table_t; typedef void (*VoidPtr)(void*); diff --git a/firmware/controllers/core/fsio_core.cpp b/firmware/controllers/core/fsio_core.cpp index e7c8855019..8807cf7ab1 100644 --- a/firmware/controllers/core/fsio_core.cpp +++ b/firmware/controllers/core/fsio_core.cpp @@ -21,7 +21,7 @@ #include "fsio_impl.h" extern fsio8_Map3D_f32t fsioTable1; -extern fsio8_Map3D_f32t fsioTable2; +extern fsio8_Map3D_u8t fsioTable2; LENameOrdinalPair * LE_FIRST = NULL; @@ -270,7 +270,7 @@ bool LECalculator::processElement(Engine *engine, LEElement *element) { push(element->action, t->getValue(xValue, yValue)); } else { - fsio8_Map3D_f32t *t = &fsioTable2; + fsio8_Map3D_u8t *t = &fsioTable2; push(element->action, t->getValue(xValue, yValue)); } diff --git a/firmware/controllers/core/fsio_impl.cpp b/firmware/controllers/core/fsio_impl.cpp index 9bc52316df..5685074074 100644 --- a/firmware/controllers/core/fsio_impl.cpp +++ b/firmware/controllers/core/fsio_impl.cpp @@ -18,7 +18,9 @@ #define NO_PWM 0 fsio8_Map3D_f32t fsioTable1("fsio#1"); -fsio8_Map3D_f32t fsioTable2("fsio#2"); +fsio8_Map3D_u8t fsioTable2("fsio#2"); +fsio8_Map3D_u8t fsioTable3("fsio#3"); +fsio8_Map3D_u8t fsioTable4("fsio#4"); /** @@ -485,6 +487,10 @@ void initFsioImpl(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S) { config->fsioTable1RpmBins); fsioTable2.init(config->fsioTable2, config->fsioTable2LoadBins, config->fsioTable2RpmBins); + fsioTable3.init(config->fsioTable3, config->fsioTable3LoadBins, + config->fsioTable3RpmBins); + fsioTable4.init(config->fsioTable4, config->fsioTable4LoadBins, + config->fsioTable4RpmBins); } diff --git a/firmware/controllers/core/table_helper.h b/firmware/controllers/core/table_helper.h index 7b5db80b6c..b018b7362a 100644 --- a/firmware/controllers/core/table_helper.h +++ b/firmware/controllers/core/table_helper.h @@ -126,7 +126,12 @@ void Map3D::setAll(vType value) { } } -typedef Map3D afr_Map3D_t; +/** + * AFR value is packed into uint8_t with a multiplier of 10 + */ +#define AFR_STORAGE_MULT 10 + +typedef Map3D afr_Map3D_t; typedef Map3D ign_Map3D_t; typedef Map3D fuel_Map3D_t; typedef Map3D baroCorr_Map3D_t; diff --git a/firmware/controllers/flash_main.h b/firmware/controllers/flash_main.h index ca024cc6b4..dde894594e 100644 --- a/firmware/controllers/flash_main.h +++ b/firmware/controllers/flash_main.h @@ -11,7 +11,7 @@ #include "engine.h" -#define FLASH_DATA_VERSION 9800 +#define FLASH_DATA_VERSION 10000 typedef enum { OK = 0, diff --git a/firmware/controllers/math/speed_density.cpp b/firmware/controllers/math/speed_density.cpp index 51e72de15b..5f7c931aca 100644 --- a/firmware/controllers/math/speed_density.cpp +++ b/firmware/controllers/math/speed_density.cpp @@ -24,7 +24,7 @@ fuel_Map3D_t veMap("VE"); fuel_Map3D_t ve2Map("VE2"); -afr_Map3D_t afrMap("AFR"); +afr_Map3D_t afrMap("AFR", 1.0 / AFR_STORAGE_MULT); baroCorr_Map3D_t baroCorrMap("baro"); #define tpMin 0 diff --git a/firmware/integration/rusefi.xml b/firmware/integration/rusefi.xml index e4f8ad5d7d..2fff432ba0 100644 --- a/firmware/integration/rusefi.xml +++ b/firmware/integration/rusefi.xml @@ -81,8 +81,8 @@ - +
RUSEFI rusEfi rusEfi - 17080 + 16376
- + -
+
- +