From b0a1b3831f4e75b81be83f7b01169d9f38081d4d Mon Sep 17 00:00:00 2001 From: rusEfi Date: Sun, 23 Aug 2015 22:01:55 -0400 Subject: [PATCH] auto-sync --- firmware/console/binary/tunerstudio_configuration.h | 3 ++- firmware/console/status_loop.cpp | 13 ++++++++----- firmware/controllers/algo/engine.h | 2 +- firmware/controllers/algo/fuel_math.cpp | 2 +- firmware/controllers/math/engine_math.cpp | 13 ++++++++----- firmware/rusefi.cpp | 2 +- firmware/tunerstudio/rusefi.ini | 4 ++++ java_console/models/src/com/rusefi/core/Sensor.java | 3 +++ 8 files changed, 28 insertions(+), 14 deletions(-) diff --git a/firmware/console/binary/tunerstudio_configuration.h b/firmware/console/binary/tunerstudio_configuration.h index b7e6af8b27..efebe217ea 100644 --- a/firmware/console/binary/tunerstudio_configuration.h +++ b/firmware/console/binary/tunerstudio_configuration.h @@ -97,7 +97,8 @@ typedef struct { float fuelLevel; float knockLevel; int totalTriggerErrorCounter; - int unused3[9]; + float wallFuelAmount; + int unused3[8]; } TunerStudioOutputChannels; #endif /* TUNERSTUDIO_CONFIGURATION_H_ */ diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index 450e05285d..6101bc8dea 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -385,7 +385,7 @@ void updateDevConsoleState(Engine *engine) { scheduleLogging(&logger); } -#if EFI_PROD_CODE +#if EFI_PROD_CODE || defined(__DOXYGEN__) /* * command example: @@ -428,7 +428,7 @@ static void showFuelInfo2(float rpm, float engineLoad) { #endif } -#if EFI_ENGINE_CONTROL +#if EFI_ENGINE_CONTROL || defined(__DOXYGEN__) static void showFuelInfo(void) { showFuelInfo2((float) getRpmE(engine), getEngineLoadT(PASS_ENGINE_PARAMETER_F)); } @@ -453,12 +453,12 @@ extern engine_pins_s enginePins; static OutputPin *leds[] = { &warningPin, &runningPin, &enginePins.errorLedPin, &communicationPin, &checkEnginePin }; static void initStatisLeds() { -#if EFI_PROD_CODE +#if EFI_PROD_CODE || defined(__DOXYGEN__) outputPinRegister("communication status 1", &communicationPin, LED_COMMUNICATION_PORT, LED_COMMUNICATION_PIN); #endif -#if EFI_WARNING_LED +#if EFI_WARNING_LED || defined(__DOXYGEN__) outputPinRegister("warning", &warningPin, LED_WARNING_PORT, LED_WARNING_PIN); outputPinRegister("is running status", &runningPin, LED_RUNNING_STATUS_PORT, @@ -544,7 +544,9 @@ static void lcdThread(void *arg) { } } -#if EFI_TUNER_STUDIO +#if EFI_TUNER_STUDIO || defined(__DOXYGEN__) + +extern WallFuel wallFuel; extern fuel_Map3D_t veMap; @@ -598,6 +600,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ tsOutputChannels->fuelLevel = engine->engineState.fuelLevel; tsOutputChannels->hasFatalError = hasFirmwareError(); tsOutputChannels->totalTriggerErrorCounter = triggerCentral.triggerState.totalTriggerErrorCounter; + tsOutputChannels->wallFuelAmount = wallFuel.getWallFuel(); tsOutputChannels->checkEngine = hasErrorCodes(); #if EFI_PROD_CODE || defined(__DOXYGEN__) diff --git a/firmware/controllers/algo/engine.h b/firmware/controllers/algo/engine.h index 4a4e622cd3..bbff08e0ac 100644 --- a/firmware/controllers/algo/engine.h +++ b/firmware/controllers/algo/engine.h @@ -43,7 +43,7 @@ public: int eventsCount; private: void clear(); - void registerInjectionEvent(NamedOutputPin *output, float angle, bool_t isSimultanious DECLARE_ENGINE_PARAMETER_S); + void registerInjectionEvent(int injectorIndex, float angle, bool_t isSimultanious DECLARE_ENGINE_PARAMETER_S); }; /** diff --git a/firmware/controllers/algo/fuel_math.cpp b/firmware/controllers/algo/fuel_math.cpp index 99d65a8d5b..ee7c9a4ac0 100644 --- a/firmware/controllers/algo/fuel_math.cpp +++ b/firmware/controllers/algo/fuel_math.cpp @@ -114,7 +114,7 @@ percent_t getInjectorDutyCycle(int rpm DECLARE_ENGINE_PARAMETER_S) { } /** - * @returns Length of fuel injection, in milliseconds + * @returns Length of each individual fuel injection, in milliseconds */ floatms_t getFuelMs(int rpm DECLARE_ENGINE_PARAMETER_S) { float theoreticalInjectionLength; diff --git a/firmware/controllers/math/engine_math.cpp b/firmware/controllers/math/engine_math.cpp index 5cb69d86cc..5d708f7dd5 100644 --- a/firmware/controllers/math/engine_math.cpp +++ b/firmware/controllers/math/engine_math.cpp @@ -112,8 +112,11 @@ void initializeIgnitionActions(angle_t advance, angle_t dwellAngle, } } -void FuelSchedule::registerInjectionEvent(NamedOutputPin *output, float angle, +void FuelSchedule::registerInjectionEvent(int injectorIndex, float angle, bool_t isSimultanious DECLARE_ENGINE_PARAMETER_S) { + + NamedOutputPin *output = &enginePins.injectors[injectorIndex]; + if (!isSimultanious && !isPinAssigned(output)) { // todo: extact method for this index math warning(OBD_PCM_Processor_Fault, "no_pin_inj #%s", output->name); @@ -173,7 +176,7 @@ void FuelSchedule::addFuelEvents(injection_mode_e mode DECLARE_ENGINE_PARAMETER_ int index = getCylinderId(engineConfiguration->specs.firingOrder, i) - 1; float angle = baseAngle + (float) CONFIG(engineCycle) * i / CONFIG(specs.cylindersCount); - registerInjectionEvent(&enginePins.injectors[index], angle, false PASS_ENGINE_PARAMETER); + registerInjectionEvent(index, angle, false PASS_ENGINE_PARAMETER); } break; case IM_SIMULTANEOUS: @@ -185,7 +188,7 @@ void FuelSchedule::addFuelEvents(injection_mode_e mode DECLARE_ENGINE_PARAMETER_ * We do not need injector pin here because we will control all injectors * simultaneously */ - registerInjectionEvent(NULL, angle, true PASS_ENGINE_PARAMETER); + registerInjectionEvent(0, angle, true PASS_ENGINE_PARAMETER); } break; case IM_BATCH: @@ -193,7 +196,7 @@ void FuelSchedule::addFuelEvents(injection_mode_e mode DECLARE_ENGINE_PARAMETER_ int index = i % (engineConfiguration->specs.cylindersCount / 2); float angle = baseAngle + i * (float) CONFIG(engineCycle) / CONFIG(specs.cylindersCount); - registerInjectionEvent(&enginePins.injectors[index], angle, false PASS_ENGINE_PARAMETER); + registerInjectionEvent(index, angle, false PASS_ENGINE_PARAMETER); if (CONFIG(twoWireBatch)) { @@ -201,7 +204,7 @@ void FuelSchedule::addFuelEvents(injection_mode_e mode DECLARE_ENGINE_PARAMETER_ * also fire the 2nd half of the injectors so that we can implement a batch mode on individual wires */ index = index + (CONFIG(specs.cylindersCount) / 2); - registerInjectionEvent(&enginePins.injectors[index], angle, false PASS_ENGINE_PARAMETER); + registerInjectionEvent(index, angle, false PASS_ENGINE_PARAMETER); } } break; diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index ca26d6cce8..955e32d4a3 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -291,5 +291,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 20150822; + return 20150823; } diff --git a/firmware/tunerstudio/rusefi.ini b/firmware/tunerstudio/rusefi.ini index aa5373e058..35163a4260 100644 --- a/firmware/tunerstudio/rusefi.ini +++ b/firmware/tunerstudio/rusefi.ini @@ -662,6 +662,10 @@ fileVersion = { 20150625 } pedalPosition = scalar, F32, 136, "%", 1, 0 injectorDutyCycle= scalar, F32, 140, "%", 1, 0 knockCount = scalar, U32, 144, "counter", 1, 0 + ; fuelLevel 148 + ; knockLevel 152 + ; totalTriggerErrorCounter 156 + wallFuelAmount = scalar, F32, 160, "ms", 1, 0 egoCorrection = { 100 } time = { timeNow } ; engineLoad = { algorithm == 0 ? MAF : TPS } diff --git a/java_console/models/src/com/rusefi/core/Sensor.java b/java_console/models/src/com/rusefi/core/Sensor.java index 709be2e08c..8602ca4ddf 100644 --- a/java_console/models/src/com/rusefi/core/Sensor.java +++ b/java_console/models/src/com/rusefi/core/Sensor.java @@ -88,6 +88,9 @@ public enum Sensor { INJECTOR_4_DWELL("inj #4", SensorCategory.SNIFFING), CURRENT_VE(SensorCategory.OPERATIONS, FieldType.FLOAT, 112, BackgroundColor.MUD), + MAP_ACCEL_DELTA(SensorCategory.OPERATIONS, FieldType.FLOAT, 124, BackgroundColor.MUD), + TPS_ACCEL_FUEL(SensorCategory.OPERATIONS, FieldType.FLOAT, 128, BackgroundColor.MUD), + WALL_FUEL(SensorCategory.OPERATIONS, FieldType.FLOAT, 160, BackgroundColor.MUD), INJ_1_2_DELTA("inj 1-2 delta", SensorCategory.SNIFFING), INJ_3_4_DELTA("inj 3-4 delta", SensorCategory.SNIFFING),