compact pinout enum syntax part two

This commit is contained in:
rusefillc 2022-05-09 07:39:56 -04:00
parent c1095c560d
commit 05ed284419
4 changed files with 10 additions and 7 deletions

Binary file not shown.

View File

@ -14,7 +14,7 @@ public class PinoutLogic {
private static final String CONFIG_BOARDS = "config/boards/";
private static final String CONNECTORS = "/connectors";
private static final String QUOTED_NONE = quote("NONE");
private static final String QUOTED_INVALID = quote("INVALID");
public static final String QUOTED_INVALID = quote("INVALID");
private final File[] boardYamlFiles;
private final String boardName;

View File

@ -146,8 +146,11 @@ public class ReaderState {
if (enums.size() <= totalCount / 2)
throw new IllegalStateException("Too many bits allocated for " + enums + " capacity=" + totalCount + "/size=" + enums.size());
*/
/*
why did we have this here? todo: remove in June 2022
for (int i = enums.size(); i < totalCount; i++)
tunerStudioLine += ", \"INVALID\"";
tunerStudioLine += ", " + PinoutLogic.QUOTED_INVALID;
*/
}
tsCustomLine.put(name, tunerStudioLine);

View File

@ -88,8 +88,8 @@ public class ConfigFieldParserTest {
TestTSProjectConsumer tsProjectConsumer = new TestTSProjectConsumer("", state);
state.readBufferedReader(test, tsProjectConsumer);
assertEquals("afr_type1 = bits, S08, 0, [0:1], \"BPSX\", \"Innovate\", \"14Point7\", \"INVALID\"\n" +
"afr_type2 = bits, S08, 1, [0:1], \"BPSX\", \"Innovate\", \"14Point7\", \"INVALID\"\n" +
assertEquals("afr_type1 = bits, S08, 0, [0:1], \"BPSX\", \"Innovate\", \"14Point7\"\n" +
"afr_type2 = bits, S08, 1, [0:1], \"BPSX\", \"Innovate\", \"14Point7\"\n" +
"int = scalar, S08, 2, \"\", 1, 0, 0, 100, 0\n" +
"; total TS size = 4\n", tsProjectConsumer.getContent());
}
@ -108,8 +108,8 @@ public class ConfigFieldParserTest {
TestTSProjectConsumer tsProjectConsumer = new TestTSProjectConsumer("", state);
state.readBufferedReader(test, tsProjectConsumer);
assertEquals("int = scalar, S08, 0, \"\", 1, 0, 0, 100, 0\n" +
"afr_type1 = bits, S16, 2, [0:1], \"BPSX\", \"Innovate\", \"14Point7\", \"INVALID\"\n" +
"afr_type2 = bits, S16, 4, [0:1], \"BPSX\", \"Innovate\", \"14Point7\", \"INVALID\"\n" +
"afr_type1 = bits, S16, 2, [0:1], \"BPSX\", \"Innovate\", \"14Point7\"\n" +
"afr_type2 = bits, S16, 4, [0:1], \"BPSX\", \"Innovate\", \"14Point7\"\n" +
"; total TS size = 8\n", tsProjectConsumer.getContent());
}
@ -126,7 +126,7 @@ public class ConfigFieldParserTest {
TestTSProjectConsumer tsProjectConsumer = new TestTSProjectConsumer("", state);
state.readBufferedReader(test, tsProjectConsumer);
assertEquals("int2 = scalar, S08, 0, \"\", 1, 0, 0, 100, 0\n" +
"afr_type3 = bits, S32, 4, [0:1], \"BPSX\", \"Innovate\", \"14Point7\", \"INVALID\"\n" +
"afr_type3 = bits, S32, 4, [0:1], \"BPSX\", \"Innovate\", \"14Point7\"\n" +
"; total TS size = 8\n", tsProjectConsumer.getContent());
}