From f8ee875c1127b1911689d845cb94347a91946e55 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Thu, 21 Jan 2016 21:03:08 -0500 Subject: [PATCH] auto-sync --- firmware/controllers/core/table_helper.h | 2 ++ firmware/rusefi.cpp | 2 +- .../ui/src/com/rusefi/logic/IgnitionMapBuilder.java | 6 +++++- .../com/rusefi/logic/test/IgnitionMapBuilderTest.java | 10 ++++++++-- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/firmware/controllers/core/table_helper.h b/firmware/controllers/core/table_helper.h index 30f09cd83e..146fa7df63 100644 --- a/firmware/controllers/core/table_helper.h +++ b/firmware/controllers/core/table_helper.h @@ -111,6 +111,8 @@ typedef Map3D ign_Map3D_t; typedef Map3D fuel_Map3D_t; typedef Map3D baroCorr_Map3D_t; +void setRpmBin(float array[], int size, float idleRpm, float topRpm); + void setTableBin(float array[], int size, float l, float r); void setTableBin2(float array[], int size, float l, float r, float precision); void setRpmTableBin(float array[], int size); diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index a8a3e6892f..652ed4300c 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -275,5 +275,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 20160116; + return 20160121; } diff --git a/java_console/ui/src/com/rusefi/logic/IgnitionMapBuilder.java b/java_console/ui/src/com/rusefi/logic/IgnitionMapBuilder.java index af1c71fe23..a347907c45 100644 --- a/java_console/ui/src/com/rusefi/logic/IgnitionMapBuilder.java +++ b/java_console/ui/src/com/rusefi/logic/IgnitionMapBuilder.java @@ -61,7 +61,11 @@ public class IgnitionMapBuilder { public static double getInitialAdvance(int rpm, double map, double advanceMax) { double advance = getAdvanceForRpm(rpm, advanceMax); - return round10(advance + 0.3 * (100 - map)); + + if (rpm > 3000) + return round10(advance + 0.1 * (100 - map)); + + return round10(advance + 0.1 * (100 - map) * rpm / 3000); } public static double round10(double result) { diff --git a/java_console/ui/src/com/rusefi/logic/test/IgnitionMapBuilderTest.java b/java_console/ui/src/com/rusefi/logic/test/IgnitionMapBuilderTest.java index 66bb022dc3..ed2a13c854 100644 --- a/java_console/ui/src/com/rusefi/logic/test/IgnitionMapBuilderTest.java +++ b/java_console/ui/src/com/rusefi/logic/test/IgnitionMapBuilderTest.java @@ -38,7 +38,13 @@ public class IgnitionMapBuilderTest { assertEquals(16.5, getAdvanceForRpm(1200, 36)); assertEquals(29.5, getAdvanceForRpm(2400, 36)); - assertEquals(47.5, getInitialAdvance(2400, 40, 36)); - assertEquals(54.0, getInitialAdvance(4400, 40, 36)); + assertEquals(36.0, getInitialAdvance(6000, 100, 36)); + assertEquals(10.0, getInitialAdvance(600, 100, 36)); + + assertEquals(44.0, getInitialAdvance(6000, 20, 36)); + + assertEquals(34.3, getInitialAdvance(2400, 40, 36)); + assertEquals(42.0, getInitialAdvance(4400, 40, 36)); + assertEquals(11.6, getInitialAdvance(600, 20, 36)); } }