From df32e6d6dac77379d4392bbdb94da605a28b4a1e Mon Sep 17 00:00:00 2001 From: rusEfi Date: Thu, 19 Mar 2015 07:10:09 -0500 Subject: [PATCH] auto-sync --- firmware/config/engines/mazda_626.cpp | 7 +++++++ firmware/console/binary/tunerstudio_configuration.h | 4 ++-- firmware/console/status_loop.cpp | 4 ++-- firmware/controllers/core/fsio_impl.cpp | 6 ++++-- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/firmware/config/engines/mazda_626.cpp b/firmware/config/engines/mazda_626.cpp index 004424d471..7f384bd3dd 100644 --- a/firmware/config/engines/mazda_626.cpp +++ b/firmware/config/engines/mazda_626.cpp @@ -66,4 +66,11 @@ void setMazda626EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) { // todo engineConfiguration->afr.hwChannel = EFI_ADC_3; initEgoSensor(&engineConfiguration->afr, ES_Innovate_MTX_L); + + +#if EFI_FSIO || defined(__DOXYGEN__) + // backup main relay pin + setFsio(engineConfiguration, 0, GPIOE_6, "1"); +#endif + } diff --git a/firmware/console/binary/tunerstudio_configuration.h b/firmware/console/binary/tunerstudio_configuration.h index ad65f3245a..39905ca820 100644 --- a/firmware/console/binary/tunerstudio_configuration.h +++ b/firmware/console/binary/tunerstudio_configuration.h @@ -41,7 +41,7 @@ typedef struct { float massAirFlowVoltage; // size 4, offset 16 float airFuelRatio; // size 4, offset 20 float engineLoad; // size 4, offset 24 - float v_batt; // size 4, offset 28 + 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 @@ -52,7 +52,7 @@ typedef struct { */ float baseFuel; // 48 float tCharge; // 52 - float inj_adv; // 56 + float ignitionAdvance; // 56 float sparkDwell; // 60 /** * this one contains fuel with all corrections. See also baseFuel diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index 664c58d77c..ddb8aa2f6a 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -544,7 +544,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ tsOutputChannels->massAirFlowValue = getRealMaf(); tsOutputChannels->veValue = veMap.getValue(getMap(), rpm); tsOutputChannels->airFuelRatio = getAfr(); - tsOutputChannels->v_batt = getVBatt(engineConfiguration); + tsOutputChannels->vBatt = getVBatt(engineConfiguration); tsOutputChannels->tpsADC = getTPS10bitAdc(PASS_ENGINE_PARAMETER_F); #if EFI_ANALOG_SENSORS || defined(__DOXYGEN__) tsOutputChannels->atmospherePressure = getBaroPressure(); @@ -588,7 +588,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ tsOutputChannels->clutchDownState = engine->clutchDownState; tsOutputChannels->tCharge = getTCharge(rpm, tps, coolant, intake); float timing = getAdvance(rpm, engineLoad PASS_ENGINE_PARAMETER); - tsOutputChannels->inj_adv = timing > 360 ? timing - 720 : timing; + tsOutputChannels->ignitionAdvance = timing > 360 ? timing - 720 : timing; tsOutputChannels->sparkDwell = getSparkDwellMsT(rpm PASS_ENGINE_PARAMETER); tsOutputChannels->baseFuel = baseFuelMs; tsOutputChannels->pulseWidthMs = getRunningFuel(baseFuelMs, rpm PASS_ENGINE_PARAMETER); diff --git a/firmware/controllers/core/fsio_impl.cpp b/firmware/controllers/core/fsio_impl.cpp index 766e0dc85d..47ab64cb41 100644 --- a/firmware/controllers/core/fsio_impl.cpp +++ b/firmware/controllers/core/fsio_impl.cpp @@ -15,6 +15,8 @@ #include "rpm_calculator.h" #include "efiGpio.h" +#define NO_PWM 0 + /** * Here we define all rusEfi-specific methods */ @@ -126,7 +128,7 @@ void setFsioExt(engine_configuration_s *engineConfiguration, int index, brain_pi } void setFsio(engine_configuration_s *engineConfiguration, int index, brain_pin_e pin, const char * exp) { - setFsioExt(engineConfiguration, index, pin, exp, 0); + setFsioExt(engineConfiguration, index, pin, exp, NO_PWM); } void applyFsioConfiguration(DECLARE_ENGINE_PARAMETER_F) { @@ -198,7 +200,7 @@ static void handleFsio(Engine *engine, int index) { if (boardConfiguration->fsioPins[index] == GPIO_UNASSIGNED) return; - bool_t isPwmMode = boardConfiguration->fsioFrequency[index] != 0; + bool_t isPwmMode = boardConfiguration->fsioFrequency[index] != NO_PWM; float fvalue = calc.getValue2(fsioLogics[index], engine); engine->engineConfiguration2->fsioLastValue[index] = fvalue;