something is broken somewhere :(
This commit is contained in:
parent
9a6dc8d101
commit
a7aea821b7
|
@ -4,7 +4,8 @@ rem This batch files reads rusefi_enums.h and produses auto_generated_enums.* fi
|
|||
|
||||
cd ../../../..
|
||||
|
||||
java -jar ../java_tools/enum2string.jar ^
|
||||
java -DSystemOut.name=gen_enum_to_string_kinetis ^
|
||||
-jar ../java_tools/enum2string.jar ^
|
||||
-inputPath . ^
|
||||
-outputPath config/boards/kinetis/config/controllers/algo ^
|
||||
-enumInputFile controllers/algo/rusefi_enums.h ^
|
||||
|
|
|
@ -28,6 +28,13 @@ public class SystemOut {
|
|||
String fileName = System.getProperty("SystemOut.name", "rusefi_tool") + LOG;
|
||||
System.out.println("Opening " + fileName);
|
||||
logFile = new PrintWriter(new FileWriter(fileName, true));
|
||||
Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
close();
|
||||
System.out.println("SystemOut Hook done!");
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
@SuppressWarnings("ThrowablePrintedToSystemOut")
|
||||
|
@ -45,8 +52,10 @@ public class SystemOut {
|
|||
println(object == null ? "(null)" : object.toString());
|
||||
}
|
||||
|
||||
public static void close() {
|
||||
logFile.close();
|
||||
public synchronized static void close() {
|
||||
if (logFile != null) {
|
||||
logFile.close();
|
||||
}
|
||||
logFile = null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/configuration_definition.iml" filepath="$PROJECT_DIR$/configuration_definition.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/../enum_to_string/enum_to_string.iml" filepath="$PROJECT_DIR$/../enum_to_string/enum_to_string.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/../../java_console/logging/logging.iml" filepath="$PROJECT_DIR$/../../java_console/logging/logging.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
|
@ -14,8 +14,9 @@
|
|||
debug="true"
|
||||
target="${javac.target}"
|
||||
destdir="build/classes"
|
||||
classpath="lib/junit.jar:lib/annotations.jar:lib/snakeyaml.jar">
|
||||
classpath="lib/junit.jar:../../java_console/lib/annotations.jar:lib/snakeyaml.jar">
|
||||
<src path="src"/>
|
||||
<src path="../../java_console/logging/src"/>
|
||||
<src path="../enum_to_string/src"/>
|
||||
</javac>
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@ public class BoardReader {
|
|||
);
|
||||
return;
|
||||
}
|
||||
|
||||
String boardName = null;
|
||||
String firmwarePath = "firmware";
|
||||
String outputPath = ".";
|
||||
|
@ -44,20 +43,24 @@ public class BoardReader {
|
|||
}
|
||||
|
||||
Yaml yaml = new Yaml();
|
||||
Map<String, Object> data = yaml.load(new FileReader(firmwarePath + "/config/boards/" + boardName + "/mapping.yaml"));
|
||||
Objects.requireNonNull(data, "mapping for " + boardName);
|
||||
SystemOut.println(data);
|
||||
String fileName = firmwarePath + "/config/boards/" + boardName + "/mapping.yaml";
|
||||
Map<String, Object> data = yaml.load(new FileReader(fileName));
|
||||
if (data == null) {
|
||||
SystemOut.println("Null yaml for " + fileName);
|
||||
} else {
|
||||
SystemOut.println(data);
|
||||
|
||||
BufferedWriter bw = new BufferedWriter(new FileWriter(outputPath + File.separator + boardName + "_prefix.txt"));
|
||||
|
||||
BufferedWriter bw = new BufferedWriter(new FileWriter(outputPath + File.separator + boardName + "_prefix.txt"));
|
||||
bw.write(processSection(data, "brain_pin_e", "output_pin_e", "outputs", "GPIO_UNASSIGNED"));
|
||||
bw.write(processSection(data, "adc_channel_e", "adc_channel_e", "analog_inputs", "EFI_ADC_NONE"));
|
||||
|
||||
bw.write(processSection(data, "brain_pin_e", "output_pin_e", "outputs", "GPIO_UNASSIGNED"));
|
||||
bw.write(processSection(data, "adc_channel_e", "adc_channel_e", "analog_inputs", "EFI_ADC_NONE"));
|
||||
bw.write(processSection(data, "brain_pin_e", "brain_input_pin_e", "event_inputs", "GPIO_UNASSIGNED"));
|
||||
bw.write(processSection(data, "brain_pin_e", "switch_input_pin_e", "switch_inputs", "GPIO_UNASSIGNED"));
|
||||
|
||||
bw.write(processSection(data, "brain_pin_e", "brain_input_pin_e", "event_inputs", "GPIO_UNASSIGNED"));
|
||||
bw.write(processSection(data, "brain_pin_e", "switch_input_pin_e", "switch_inputs", "GPIO_UNASSIGNED"));
|
||||
|
||||
bw.close();
|
||||
bw.close();
|
||||
}
|
||||
SystemOut.close();
|
||||
}
|
||||
|
||||
private static String processSection(Map<String, Object> data, String headerEnumName, String outputEnumName, String sectionName, String NOTHING_NAME) {
|
||||
|
|
Loading…
Reference in New Issue