diff --git a/firmware/.cproject b/firmware/.cproject
index a0ae5e0152..6658141df9 100644
--- a/firmware/.cproject
+++ b/firmware/.cproject
@@ -5,16 +5,16 @@
-
+
-
+
@@ -127,6 +127,7 @@
+
@@ -200,16 +201,16 @@
-
+
-
+
@@ -283,16 +284,16 @@
-
+
-
+
@@ -569,16 +570,16 @@
-
+
-
+
diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt
index 4a3231ee59..c4a95f54f9 100644
--- a/firmware/integration/rusefi_config.txt
+++ b/firmware/integration/rusefi_config.txt
@@ -205,7 +205,7 @@ firing_order_e firingOrder;
end_struct
specs_s specs
- float cylinderBore;+Cylinder diameter, in mm.
+ float cylinderBore;+Cylinder diameter, in mm.;"mm", 1, 0, 0, 20000.0, 2
int sensorSnifferRpmThreshold;+Disable sensor sniffer above this rpm;"RPM", 1, 0, 0,30000, 0
int rpmHardLimit;;"rpm", 1, 0, 0, 20000.0, 2
diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp
index 218f55b0b3..d73dddc66d 100644
--- a/firmware/rusefi.cpp
+++ b/firmware/rusefi.cpp
@@ -298,5 +298,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 20160609;
+ return 20160611;
}
diff --git a/firmware/tunerstudio/rusefi.ini b/firmware/tunerstudio/rusefi.ini
index 6a023f67c4..1e1b80b6a0 100644
--- a/firmware/tunerstudio/rusefi.ini
+++ b/firmware/tunerstudio/rusefi.ini
@@ -41,7 +41,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
-; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Fri Jun 10 18:45:59 EDT 2016
+; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sat Jun 11 15:06:14 EDT 2016
pageSize = 17080
page = 1
@@ -95,7 +95,7 @@ page = 1
displacement = scalar, F32, 400, "L", 1, 0, 0, 1000.0, 2
cylindersCount = bits, U32, 404, [0:3], "INVALID", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, "INVALID", "INVALID", "INVALID"
firingOrder = bits, U32, 408, [0:3], "One Cylinder", "1-3-4-2", "1-2-4-3", "1-3-2-4", "1-5-3-6-2-4", "1-8-4-3-6-5-7-2", "1-5-3-6-2-4", "1-4-2-5-3-6", "1-2", "1_2_3_4_5_6", "1-2-3", "1-8-7-2-6-5-4-3", "1-5-4-2-6-3-7-8", "fo13", "fo14", "INVALID"
-;skipping cylinderBore offset 412
+ cylinderBore = scalar, F32, 412, "mm", 1, 0, 0, 20000.0, 2
sensorSnifferRpmThreshold = scalar, S32, 416, "RPM", 1, 0, 0,30000, 0
rpmHardLimit = scalar, S32, 420, "rpm", 1, 0, 0, 20000.0, 2
algorithm = bits, U32, 424, [0:1], "MAF", "Alpha-N/TPS", "MAP", "SPEED DENSITY"
@@ -107,7 +107,7 @@ page = 1
ignitionOffset = scalar, F32, 448, "RPM", 1, 0, 0, 3000.0, 0
timingMode = bits, U32, 452 [0:0], "dynamic", "fixed"
fixedModeTiming = scalar, F32, 456, "RPM", 1, 0, 0, 3000.0, 0
- globalTriggerAngleOffset = scalar, F32, 460, "deg", 1, 0, 0, 720, 0
+ globalTriggerAngleOffset = scalar, F32, 460, "deg", 1, 0, -720, 720, 0
analogInputDividerCoefficient = scalar, F32, 464, "coef", 1, 0, 0.01, 10.0, 2
vbattDividerCoeff = scalar, F32, 468, "coef", 1, 0, 0.01, 20.0, 2
vbattAdcChannel = bits, U32, 472, [0:4] "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PB0", "PB1", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "Disabled", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID"
@@ -1320,7 +1320,7 @@ cmd_test_idle_valve = "w\x00\x17\x00\x01"
field = "Trigger type", trigger_type
field = "Operation mode", operationMode
field = "With VR sensors only rising edge has reliable position"
- field = "use only rising edge", useOnlyFrontForTrigger
+ field = "use only rising edge", useOnlyRisingEdgeForTrigger
field = "Trigger Angle Offset", globalTriggerAngleOffset
field = "#Custom Trigger"
field = "Synchronization Needed?", trigger_customIsSynchronizationNeeded, {trigger_type == 0}
diff --git a/java_console/.idea/runConfigurations/TS2C_ignitionTable.xml b/java_console/.idea/runConfigurations/TS2C_ignitionTable.xml
new file mode 100644
index 0000000000..f112833ce9
--- /dev/null
+++ b/java_console/.idea/runConfigurations/TS2C_ignitionTable.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/java_console/.idea/runConfigurations/TS2C_veTable.xml b/java_console/.idea/runConfigurations/TS2C_veTable.xml
new file mode 100644
index 0000000000..fe3c0002d1
--- /dev/null
+++ b/java_console/.idea/runConfigurations/TS2C_veTable.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/java_console/models/src/com/rusefi/TS2C.java b/java_console/models/src/com/rusefi/TS2C.java
new file mode 100644
index 0000000000..f1f5a1d209
--- /dev/null
+++ b/java_console/models/src/com/rusefi/TS2C.java
@@ -0,0 +1,133 @@
+package com.rusefi;
+
+import java.io.*;
+import java.util.Arrays;
+import java.util.Date;
+
+/**
+ * 12/27/2014
+ * Andrey Belomutskiy, (c) 2012-2015
+ */
+@SuppressWarnings("StringConcatenationInsideStringBufferAppend")
+public class TS2C {
+ // todo: replace with LOAD_COUNT & RPM_COUNT
+ private static final int SIZE = 16;
+
+ private static int RPM_COUNT = 16;
+ private static int LOAD_COUNT = 16;
+
+ static float loadBins[] = new float[LOAD_COUNT];
+ static float rpmBins[] = new float[RPM_COUNT];
+ static float table[][] = new float[SIZE][];
+
+ public static void main(String[] args) throws IOException {
+
+ if (args.length != 4) {
+ System.out.println("Four parameters expected: ");
+ System.out.println(" INPUT_MSQ_FILE NAME LOAD_SECTION_NAME RPM_SECTION_NAME TABLE_NAME");
+ System.out.println("for example");
+ // section names are needed in order to generate comments about cell content
+ System.out.println(" currenttune.msq veLoadBins veRpmBins veTable");
+ System.exit(-1);
+ }
+ String fileName = args[0];
+ String loadSectionName = args[1];
+ String rpmSectionName = args[2];
+ String tableName = args[3];
+
+ BufferedReader r = readAndScroll(fileName, loadSectionName);
+ readAxle(loadBins, r);
+ r = readAndScroll(fileName, rpmSectionName);
+ readAxle(rpmBins, r);
+
+ for (int i = 0; i < SIZE; i++) {
+ table[i] = new float[SIZE];
+ }
+
+ r = readAndScroll(fileName, tableName);
+ readTable(table, r);
+
+ BufferedWriter w = new BufferedWriter(new FileWriter("output.c"));
+ writeTable(w, new ValueSource() {
+ @Override
+ public float getValue(int loadIndex, int rpmIndex) {
+ return table[loadIndex][rpmIndex];
+ }
+ }, "TS2C");
+ }
+
+ static void writeTable(BufferedWriter w, ValueSource valueSource, String toolName) throws IOException {
+ w.write("/* Generated by " + toolName + " on " + new Date() + "*/\r\n");
+ for (int loadIndex = 0; loadIndex < LOAD_COUNT; loadIndex++)
+ writeLine(valueSource, w, loadIndex);
+ w.close();
+ }
+
+ private static BufferedReader readAndScroll(String fileName, String sectionName) throws IOException {
+ BufferedReader reader = new BufferedReader(new FileReader(fileName));
+ System.out.println("Reading from " + fileName + ", scrolling to " + sectionName);
+ String line;
+ while ((line = reader.readLine()) != null) {
+ if (line.contains(sectionName)) {
+ System.out.println("Found " + line);
+ break;
+ }
+ }
+ return reader;
+ }
+
+ private static void writeLine(ValueSource valueSource, BufferedWriter w, int loadIndex) throws IOException {
+ StringBuilder sb = new StringBuilder("{");
+
+ sb.append("/* " + loadIndex + " " + String.format("%3.3f", loadBins[loadIndex]) + "\t*/");
+ for (int rpmIndex = 0; rpmIndex < RPM_COUNT; rpmIndex++) {
+ sb.append("/* " + rpmIndex + " " + rpmBins[rpmIndex] + "*/" + String.format("%3.3f", valueSource.getValue(loadIndex, rpmIndex)) + ",\t");
+ }
+ sb.append("},\r\n");
+
+ w.write(sb.toString());
+ }
+
+ interface ValueSource {
+ float getValue(int loadIndex, int rpmIndex);
+ }
+
+ private static void readTable(float[][] table, BufferedReader r) throws IOException {
+ int index = 0;
+
+ while (index < SIZE) {
+ String line = r.readLine();
+ if (line == null)
+ throw new IOException("End of file?");
+ line = line.trim();
+ if (line.isEmpty())
+ continue;
+
+ String[] values = line.split(" ");
+ if (values.length != SIZE)
+ throw new IllegalStateException("Unexpected line: " + line);
+
+ for (int i = 0; i < SIZE; i++) {
+ table[index][i] = Float.parseFloat(values[i]);
+ }
+ System.out.println("Got line " + index + ": " + Arrays.toString(table[index]));
+ index++;
+ }
+ }
+
+ private static void readAxle(float[] bins, BufferedReader r) throws IOException {
+ int index = 0;
+
+ while (index < SIZE) {
+ String line = r.readLine();
+ if (line == null)
+ throw new IOException("End of file?");
+ line = line.trim();
+ if (line.isEmpty())
+ continue;
+ bins[index++] = Float.parseFloat(line);
+ }
+
+ System.out.println("Got bins " + Arrays.toString(bins));
+ }
+}