From 2d393151f66462842efde1016a844a3eb6fc0a28 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Tue, 12 May 2015 18:09:59 -0400 Subject: [PATCH] auto-sync --- .../binary/tunerstudio_configuration.h | 5 +++-- firmware/console/status_loop.cpp | 5 ++++- firmware/controllers/flash_main.h | 2 +- firmware/integration/rusefi_config.txt | 4 ++-- firmware/rusefi.cpp | 2 +- firmware/tunerstudio/rusefi.ini | 20 ++++++++++++++----- 6 files changed, 26 insertions(+), 12 deletions(-) diff --git a/firmware/console/binary/tunerstudio_configuration.h b/firmware/console/binary/tunerstudio_configuration.h index 63abfc7d4c..bf219e0dfb 100644 --- a/firmware/console/binary/tunerstudio_configuration.h +++ b/firmware/console/binary/tunerstudio_configuration.h @@ -38,7 +38,7 @@ typedef struct { float vBatt; // size 4, offset 28 short int tpsADC; // size 2, offset 32 short int alignment; // size 2, offset 34 - float atmospherePressure; // size 4, offset 36 + float baroPressure; // size 4, offset 36 float manifold_air_pressure; // size 4, offset 40 float crankingFuelMs; /** @@ -89,7 +89,8 @@ typedef struct { int triggerErrorsCounter; float currentMapAccelDelta; float tpsAccelFuel; - int unused3[16]; + float baroCorrection; + int unused3[15]; } TunerStudioOutputChannels; #endif /* TUNERSTUDIO_CONFIGURATION_H_ */ diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index 42816bd57c..5457838cd4 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -390,6 +390,8 @@ static void showFuelInfo2(float rpm, float engineLoad) { scheduleMsg(&logger2, "phase=%f correction=%f", getInjectionAngle(rpm), engineConfiguration->globalFuelCorrection); + scheduleMsg(&logger2, "baro correction=%f", engine->engineState.baroCorrection); + #if EFI_ENGINE_CONTROL scheduleMsg(&logger, "base cranking fuel %f", engineConfiguration->cranking.baseFuel); scheduleMsg(&logger2, "cranking fuel: %f", getCrankingFuel(PASS_ENGINE_PARAMETER_F)); @@ -559,7 +561,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ tsOutputChannels->vBatt = getVBatt(engineConfiguration); tsOutputChannels->tpsADC = getTPS10bitAdc(PASS_ENGINE_PARAMETER_F); #if EFI_ANALOG_SENSORS || defined(__DOXYGEN__) - tsOutputChannels->atmospherePressure = getBaroPressure(); + tsOutputChannels->baroPressure = getBaroPressure(); #endif /* EFI_ANALOG_SENSORS */ tsOutputChannels->manifold_air_pressure = getMap(); tsOutputChannels->engineLoad = engineLoad; @@ -568,6 +570,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ tsOutputChannels->tpsAccelFuel = engine->tpsAccelEnrichment.getTpsEnrichment(PASS_ENGINE_PARAMETER_F); tsOutputChannels->deltaTps = engine->tpsAccelEnrichment.getDelta(); tsOutputChannels->triggerErrorsCounter = triggerCentral.triggerState.totalTriggerErrorCounter; + tsOutputChannels->baroCorrection = engine->engineState.baroCorrection; tsOutputChannels->checkEngine = hasErrorCodes(); #if EFI_PROD_CODE || defined(__DOXYGEN__) diff --git a/firmware/controllers/flash_main.h b/firmware/controllers/flash_main.h index f7a1d2607a..a7e8219d23 100644 --- a/firmware/controllers/flash_main.h +++ b/firmware/controllers/flash_main.h @@ -12,7 +12,7 @@ #include "engine_configuration.h" #include "engine.h" -#define FLASH_DATA_VERSION 8000 +#define FLASH_DATA_VERSION 8050 void readFromFlash(void); void initFlash(Logging *sharedLogger, Engine *engine); diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index f42c5cb221..9491933cab 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -519,8 +519,8 @@ float noAccelAfterHardLimitPeriodSecs;;"sec", 1, 0, 0, 60, int mapAveragingSchedulingAtIndex; -float[BARO_CORR_SIZE] baroCorrPressureBins; -float[BARO_CORR_SIZE] baroCorrRpmBins; +float[BARO_CORR_SIZE] baroCorrPressureBins;;"kPa", 1, 0, 0.0, 200, 2 +float[BARO_CORR_SIZE] baroCorrRpmBins;;"RPM", 1, 0, 0.0, 18000, 2 baro_corr_table_t baroCorrTable; int[109] unused3; diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index 7aeedbea02..5e9a39aab3 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -290,5 +290,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 20150510; + return 20150512; } diff --git a/firmware/tunerstudio/rusefi.ini b/firmware/tunerstudio/rusefi.ini index 764d63a01c..5c2c5707ea 100644 --- a/firmware/tunerstudio/rusefi.ini +++ b/firmware/tunerstudio/rusefi.ini @@ -40,7 +40,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; CONFIG_DEFINITION_START -; this section was generated by ConfigDefinition.jar on Tue May 12 14:18:59 EDT 2015 +; this section was generated by ConfigDefinition.jar on Tue May 12 17:29:48 EDT 2015 pageSize = 15288 page = 1 @@ -455,8 +455,8 @@ page = 1 stepperEnablePin = bits, U32, 1640, [0:6], "GPIOA_0", "GPIOA_1", "GPIOA_2", "GPIOA_3", "GPIOA_4", "GPIOA_5", "GPIOA_6", "GPIOA_7", "GPIOA_8", "GPIOA_9", "GPIOA_10", "GPIOA_11", "GPIOA_12", "GPIOA_13", "GPIOA_14", "GPIOA_15", "GPIOB_0", "GPIOB_1", "GPIOB_2", "GPIOB_3", "GPIOB_4", "GPIOB_5", "GPIOB_6", "GPIOB_7", "GPIOB_8", "GPIOB_9", "GPIOB_10", "GPIOB_11", "GPIOB_12", "GPIOB_13", "GPIOB_14", "GPIOB_15", "GPIOC_0", "GPIOC_1", "GPIOC_2", "GPIOC_3", "GPIOC_4", "GPIOC_5", "GPIOC_6", "GPIOC_7", "GPIOC_8", "GPIOC_9", "GPIOC_10", "GPIOC_11", "GPIOC_12", "GPIOC_13", "GPIOC_14", "GPIOC_15", "GPIOD_0", "GPIOD_1", "GPIOD_2", "GPIOD_3", "GPIOD_4", "GPIOD_5", "GPIOD_6", "GPIOD_7", "GPIOD_8", "GPIOD_9", "GPIOD_10", "GPIOD_11", "GPIOD_12", "GPIOD_13", "GPIOD_14", "GPIOD_15", "GPIOE_0", "GPIOE_1", "GPIOE_2", "GPIOE_3", "GPIOE_4", "GPIOE_5", "GPIOE_6", "GPIOE_7", "GPIOE_8", "GPIOE_9", "GPIOE_10", "GPIOE_11", "GPIOE_12", "GPIOE_13", "GPIOE_14", "GPIOE_15", "NONE", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" noAccelAfterHardLimitPeriodSecs = scalar, F32, 1644, "sec", 1, 0, 0, 60, 0 ;skipping mapAveragingSchedulingAtIndex offset 1648 -;skipping baroCorrPressureBins offset 1652 -;skipping baroCorrRpmBins offset 1668 + baroCorrPressureBins = array, F32, 1652, [4], "kPa", 1, 0, 0.0, 200, 2 + baroCorrRpmBins = array, F32, 1668, [4], "RPM", 1, 0, 0.0, 18000, 2 baroCorrTable = array, F32, 1684, [4x4],"%", 1, 0, 0, 999.0, 2 ;skipping unused3 offset 1748 tpsAccelLength = scalar, S32, 2184, "len", 1, 0, 1, 200, 3 @@ -587,7 +587,7 @@ fileVersion = { 20150506 } ; 10 bit TPS ADC value (from 0 to 1023 in 5v scale) tpsADC = scalar, U16, 32, "ADC", 1, 0.0; alignmet = scalar, U16, 34, "al", 1, 0.0; - atmPres = scalar, F32, 36, "pres", 1, 0.0; + baroPressure = scalar, F32, 36, "pres", 1, 0.0; MAPValue = scalar, F32, 40, "MAP", 1, 0.0; ; total fuel squirt duration (in MS) per engine cycle according to current CLT crankingFuel = scalar, F32, 44, "ms", 1, 0.0; @@ -734,6 +734,15 @@ fileVersion = { 20150506 } gridOrient = 250, 0, 340 ; Space 123 rotation of grid in degrees. upDownLabel = "(RICHER)", "(LEANER)" + table = baroCorrTbl, baroCorrMap, "Baro Correction", 1 + ; constant, variable + xBins = baroCorrRpmBins, rpm + yBins = baroCorrPressureBins, baroPressure + zBins = baroCorrTable +; gridHeight = 2.0 + gridOrient = 250, 0, 340 ; Space 123 rotation of grid in degrees. + upDownLabel = "(RICHER)", "(LEANER)" + table = ignitionTableTbl, ignitionTableMap, "Ignition Table", 1 ; constant, variable xBins = ignitionRpmBins, rpm @@ -799,7 +808,7 @@ fileVersion = { 20150506 } mafGaugeVolts = MAF, "Mass Air Flow", "v", 0, 5, 0, 1, 3, 4, 1, 1 VBattGauge = VBatt, "Battery Voltage", "V", 8, 21, 9, 10, 17, 19, 1, 1 tpsADCGauge = tpsADC, "tps ADC", "ADC", 0, 1024, 0, 0, 0, 0, 0, 0 - atmPresCGauge = atmPres, "atmo pressu", "kPa", 0, 1024, 0, 0, 0, 0, 0, 0 + atmPresCGauge = baroPressure, "Baro", "kPa", 0, 1024, 0, 0, 0, 0, 0, 0 mapGaugeValue = MAPValue, "MAP", "kPa", 0, 300, 10, 10, 200, 200, 0, 0 pulseWidthGauge = pulseWidth, "final fuel squirt, per injection", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1 baseFuelGauge = baseFuel, "Base fuel duration, before corr", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1 @@ -947,6 +956,7 @@ fileVersion = { 20150506 } subMenu = std_separator subMenu = ignitionTableTbl, "Ignition Table" subMenu = ignitionIatCorrTableTbl, "Ignition Intake Air Temp correction" + subMenu = baroCorrTbl, "Baro Correction", {algorithm == 3} subMenu = std_separator menu = "3D Map Tuning"