diff --git a/firmware/controllers/algo/fuel_math.cpp b/firmware/controllers/algo/fuel_math.cpp index 0fd4658db8..89e7d74a38 100644 --- a/firmware/controllers/algo/fuel_math.cpp +++ b/firmware/controllers/algo/fuel_math.cpp @@ -109,8 +109,9 @@ static int getNumberOfInjections(injection_mode_e mode DECLARE_ENGINE_PARAMETER_ } percent_t getInjectorDutyCycle(int rpm DECLARE_ENGINE_PARAMETER_S) { -// float totalPerCycle = getFuelMs(rpm) * getNumberOfInjections() - return 0; + floatms_t totalPerCycle = getFuelMs(rpm) * getNumberOfInjections(engineConfiguration->injectionMode PASS_ENGINE_PARAMETER); + floatms_t engineCycleTime = getCrankshaftRevolutionTimeMs(rpm) * (engineConfiguration->operationMode == TWO_STROKE ? 1 : 2); + return 100 * totalPerCycle / engineCycleTime; } /** diff --git a/firmware/controllers/math/engine_math.cpp b/firmware/controllers/math/engine_math.cpp index ff60a2355d..854a141eef 100644 --- a/firmware/controllers/math/engine_math.cpp +++ b/firmware/controllers/math/engine_math.cpp @@ -38,7 +38,7 @@ extern engine_pins_s enginePins; /** * @return number of milliseconds in one crankshaft revolution */ -float getCrankshaftRevolutionTimeMs(int rpm) { +floatms_t getCrankshaftRevolutionTimeMs(int rpm) { return 360 * getOneDegreeTimeMs(rpm); } diff --git a/firmware/controllers/math/engine_math.h b/firmware/controllers/math/engine_math.h index 3309ec2515..9faf2d4788 100644 --- a/firmware/controllers/math/engine_math.h +++ b/firmware/controllers/math/engine_math.h @@ -54,7 +54,7 @@ void initializeIgnitionActions(angle_t advance, angle_t dwellAngle, */ #define getOneDegreeTimeNt(rpm) (US2NT(1000000) * 60.0f / 360 / (rpm)) -float getCrankshaftRevolutionTimeMs(int rpm); +floatms_t getCrankshaftRevolutionTimeMs(int rpm); #define isCrankingR(rpm) ((rpm) > 0 && (rpm) < CONFIG(cranking.rpm)) diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index 4bd1944fb5..cb17eeb974 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 20150906; + return 20150907; } diff --git a/firmware/svnversion.h b/firmware/svnversion.h index 763093ce5f..eb7cc39188 100644 --- a/firmware/svnversion.h +++ b/firmware/svnversion.h @@ -1,5 +1,5 @@ // This file was generated by Version2Header -// Sat Aug 22 13:41:44 EDT 2015 +// Mon Sep 07 08:34:03 EDT 2015 #ifndef VCS_VERSION -#define VCS_VERSION "8659" +#define VCS_VERSION "8764" #endif diff --git a/java_console/models/src/com/rusefi/core/Sensor.java b/java_console/models/src/com/rusefi/core/Sensor.java index 329f56192c..9fd3726865 100644 --- a/java_console/models/src/com/rusefi/core/Sensor.java +++ b/java_console/models/src/com/rusefi/core/Sensor.java @@ -91,6 +91,7 @@ public enum Sensor { 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), + Injector_duty(SensorCategory.OPERATIONS, FieldType.FLOAT, 140, BackgroundColor.MUD), WALL_FUEL(SensorCategory.OPERATIONS, FieldType.FLOAT, 160, BackgroundColor.MUD), temperatureFuelCorrection(SensorCategory.OPERATIONS, FieldType.FLOAT, 164, BackgroundColor.MUD, 0, 5), wallFuelCorrection(SensorCategory.OPERATIONS, FieldType.FLOAT, 168, BackgroundColor.MUD), diff --git a/java_console/ui/src/com/rusefi/Launcher.java b/java_console/ui/src/com/rusefi/Launcher.java index 735aa9f875..68710d8fe9 100644 --- a/java_console/ui/src/com/rusefi/Launcher.java +++ b/java_console/ui/src/com/rusefi/Launcher.java @@ -32,7 +32,7 @@ import static com.rusefi.ui.storage.PersistentConfiguration.getConfig; * @see com.rusefi.StartupFrame */ public class Launcher { - public static final int CONSOLE_VERSION = 20150903; + public static final int CONSOLE_VERSION = 20150907; public static final boolean SHOW_STIMULATOR = false; private static final String TAB_INDEX = "main_tab"; protected static final String PORT_KEY = "port";