only:Improve toolset for default tune canned tune generation #4871

This commit is contained in:
Andrey 2023-06-16 21:32:34 -04:00
parent 60bb347cf1
commit 4fe7e4138b
3 changed files with 4 additions and 4 deletions

View File

@ -27,9 +27,8 @@ public class WriteSimulatorConfiguration {
}
private static void writeTune() throws JAXBException, IOException {
String s = "generated/simulator_tune_image.bin";
byte[] fileContent = Files.readAllBytes(new File(s).toPath());
System.out.println("Got " + fileContent.length + " from " + s + " while expecting " + Fields.TOTAL_CONFIG_SIZE);
byte[] fileContent = Files.readAllBytes(new File(Fields.SIMULATOR_TUNE_BIN_FILE_NAME).toPath());
System.out.println("Got " + fileContent.length + " from " + Fields.SIMULATOR_TUNE_BIN_FILE_NAME + " while expecting " + Fields.TOTAL_CONFIG_SIZE);
if (fileContent.length != Fields.TOTAL_CONFIG_SIZE)
throw new IllegalStateException("Unexpected image size " + fileContent.length);
ConfigurationImage configuration = new ConfigurationImage(fileContent);

View File

@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

View File

@ -87,7 +87,7 @@ static void runCanGpioTest() {
}
static void writeSimulatorTune() {
FILE *ptr = fopen("generated/simulator_tune_image.bin", "wb");
FILE *ptr = fopen(SIMULATOR_TUNE_BIN_FILE_NAME, "wb");
fwrite(&persistentState.persistentConfiguration, 1, sizeof(persistentState.persistentConfiguration), ptr);
fclose(ptr);
}