processor progress

This commit is contained in:
rusefi 2020-04-12 23:32:22 -04:00
parent 63403ab741
commit 302fc02545
2 changed files with 3 additions and 2 deletions

View File

@ -55,6 +55,7 @@ public class VariableRegistry extends TreeMap<String, String> {
SystemOut.println("Not redefining " + var); SystemOut.println("Not redefining " + var);
return; return;
} }
value = applyVariables(value);
SystemOut.println("Registering " + var + " as " + value); SystemOut.println("Registering " + var + " as " + value);
put(var, value); put(var, value);

View File

@ -57,7 +57,7 @@ public class ConfigFieldParserTest {
String test = "struct pid_s\n" + String test = "struct pid_s\n" +
"#define ERROR_BUFFER_SIZE 120\n" + "#define ERROR_BUFFER_SIZE 120\n" +
"#define ERROR_BUFFER_COUNT 120\n" + "#define ERROR_BUFFER_COUNT 120\n" +
"#define RESULT 120*@@ERROR_BUFFER_COUNT@@\n" + "#define RESULT @@ERROR_BUFFER_SIZE@@*@@ERROR_BUFFER_COUNT@@\n" +
"\tint16_t periodMs;PID dTime;\"ms\", 1, 0, 0, 3000, 0\n" + "\tint16_t periodMs;PID dTime;\"ms\", 1, 0, 0, 3000, 0\n" +
"end_struct\n" + "end_struct\n" +
""; "";
@ -68,7 +68,7 @@ public class ConfigFieldParserTest {
assertEquals("#define ERROR_BUFFER_COUNT 120\n" + assertEquals("#define ERROR_BUFFER_COUNT 120\n" +
"#define ERROR_BUFFER_SIZE 120\n" + "#define ERROR_BUFFER_SIZE 120\n" +
"#define RESULT 120*@@ERROR_BUFFER_COUNT@@\n", VariableRegistry.INSTANCE.getDefinesSection()); "#define RESULT 120*120\n", VariableRegistry.INSTANCE.getDefinesSection());
} }
@Test @Test