From b61f93242edda00154471f1a396433c855f6abe8 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Tue, 9 Dec 2014 20:03:04 -0600 Subject: [PATCH] auto-sync --- firmware/config/engines/dodge_neon.cpp | 5 +++-- firmware/console/status_loop.cpp | 8 +++++++- .../console/tunerstudio/tunerstudio_configuration.h | 12 +++++++++--- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/firmware/config/engines/dodge_neon.cpp b/firmware/config/engines/dodge_neon.cpp index ef679eb5e7..0dee13e2b1 100644 --- a/firmware/config/engines/dodge_neon.cpp +++ b/firmware/config/engines/dodge_neon.cpp @@ -4,6 +4,7 @@ * DODGE_NEON_1995 = 2 * * DODGE_NEON_2003 = 23 + * set_engine_type 23 * * This config overrides some values of the default configuration which is set by setDefaultConfiguration() method * @@ -274,8 +275,8 @@ void setDodgeNeonNGCEngineConfiguration(engine_configuration_s *engineConfigurat */ engineConfiguration->cltAdcChannel = EFI_ADC_12; - setFsioExt(engineConfiguration, 0, GPIOE_10, "0.6", 400); - + boardConfiguration->fsio_setting[0] = 0.55; + setFsioExt(engineConfiguration, 0, GPIOE_10, "0 fsio_setting", 400); } #endif /* EFI_SUPPORT_DODGE_NEON */ diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index 2d2a803d67..f118940f34 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -443,6 +443,10 @@ void updateTunerStudioState(Engine *engine, TunerStudioOutputChannels *tsOutputC float engineLoad = getEngineLoadT(PASS_ENGINE_PARAMETER); float baseFuelMs = getBaseTableFuel(engineConfiguration, (int) rpm, engineLoad); + // header + tsOutputChannels->tsConfigVersion = TS_FILE_VERSION; + + // engine state tsOutputChannels->rpm = rpm; tsOutputChannels->coolant_temperature = coolant; tsOutputChannels->intake_air_temperature = intake; @@ -450,10 +454,11 @@ void updateTunerStudioState(Engine *engine, TunerStudioOutputChannels *tsOutputC tsOutputChannels->mass_air_flow = getMaf(); tsOutputChannels->air_fuel_ratio = getAfr(); tsOutputChannels->v_batt = getVBatt(engineConfiguration); - tsOutputChannels->tsConfigVersion = TS_FILE_VERSION; tsOutputChannels->tpsADC = getTPS10bitAdc(PASS_ENGINE_PARAMETER_F); tsOutputChannels->atmospherePressure = getBaroPressure(); tsOutputChannels->manifold_air_pressure = getMap(); + tsOutputChannels->engineLoad = engineLoad; + tsOutputChannels->checkEngine = hasErrorCodes(); #if EFI_PROD_CODE tsOutputChannels->egtValues.values[0] = getEgtValue(boardConfiguration, 0); @@ -476,6 +481,7 @@ void updateTunerStudioState(Engine *engine, TunerStudioOutputChannels *tsOutputC float timing = getAdvance(rpm, engineLoad PASS_ENGINE_PARAMETER); tsOutputChannels->inj_adv = timing > 360 ? timing - 720 : timing; tsOutputChannels->sparkDwell = getSparkDwellMsT(rpm PASS_ENGINE_PARAMETER); + tsOutputChannels->baseFuel = baseFuelMs; tsOutputChannels->pulseWidthMs = getRunningFuel(baseFuelMs, rpm PASS_ENGINE_PARAMETER); tsOutputChannels->crankingFuelMs = getCrankingFuel(engine); } diff --git a/firmware/console/tunerstudio/tunerstudio_configuration.h b/firmware/console/tunerstudio/tunerstudio_configuration.h index 39307c68d3..8571dc8aca 100644 --- a/firmware/console/tunerstudio/tunerstudio_configuration.h +++ b/firmware/console/tunerstudio/tunerstudio_configuration.h @@ -36,22 +36,28 @@ typedef struct { float throttle_positon; // size 4, offset 12 float mass_air_flow; // size 4, offset 16 float air_fuel_ratio; // size 4, offset 20 - float fuel_load; // size 4, offset 24 + float engineLoad; // size 4, offset 24 float v_batt; // 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 manifold_air_pressure; // size 4, offset 40 float crankingFuelMs; - int unused; + /** + * This is the raw value we take from the fuel map or base fuel algorithm, before the corrections + */ + float baseFuel; float tCharge; // 52 float inj_adv; // 56 float sparkDwell; // 60 + /** + * this one contains fuel with all corrections. See also baseFuel + */ float pulseWidthMs; // 64 float warmUpEnrich; // 68 /** * Yes, I do not really enjoy packing bits into integers but we simply have too many boolean flags and I cannot - * water 4 bytes per trafic - I want gauges to work as fast as possible + * water 4 bytes per traffic - I want gauges to work as fast as possible */ unsigned int hasSdCard : 1; // bit 0 unsigned int ignition_enabled : 1; // bit 1